提交 9ae0ba06 编写于 作者: K Kohsuke Kawaguchi

added a CLI command to obtain session ID

上级 4bd06963
package hudson.cli;
import hudson.Extension;
import jenkins.model.Jenkins;
/**
* Prints the current session ID number (that changes for every run)
* to allow clients to reliably wait for a restart.
*
* @author Kohsuke Kawaguchi
*/
@Extension
public class SessionIdCommand extends CLICommand {
@Override
public String getShortDescription() {
return "Outputs the session ID, which changes every time Jenkins restarts";
}
protected int run() {
stdout.println(Jenkins.SESSION_HASH);
return 0;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册