agent新增tag启动参数

This commit is contained in:
fddc 2021-05-31 13:06:09 +08:00
parent 49c7d18c00
commit 973322370a
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,20 @@
package tech.powerjob.official.processors.impl.script;
/**
* python processor
*
* @author fddc
* @since 2021/5/14
*/
public class PowerShellProcessor extends AbstractScriptProcessor {
@Override
protected String getScriptName(Long instanceId) {
return String.format("powershell_%d.bat", instanceId);
}
@Override
protected String getRunCommand() {
return "powershell.exe";
}
}

View File

@ -36,6 +36,9 @@ public class MainApplication implements Runnable {
@Option(names = {"-l", "--length"}, description = "ProcessResult#msg max length")
private int length = 1024;
@Option(names = {"-t", "--tag"}, description = "worker-agent's tag")
private String tag;
public static void main(String[] args) {
CommandLine commandLine = new CommandLine(new MainApplication());
commandLine.execute(args);
@ -52,6 +55,7 @@ public class MainApplication implements Runnable {
cfg.setServerAddress(Splitter.on(",").splitToList(server));
cfg.setStoreStrategy(StoreStrategy.MEMORY.name().equals(storeStrategy) ? StoreStrategy.MEMORY : StoreStrategy.DISK);
cfg.setMaxResultLength(length);
cfg.setTag(tag);
PowerJobWorker worker = new PowerJobWorker();
worker.setConfig(cfg);