feat: 添加 worker tag 配置

This commit is contained in:
脏兮兮 2022-09-01 07:05:16 +08:00 committed by GitHub
parent 62d682fbd5
commit e585ba5a19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 1 deletions

View File

@ -73,6 +73,10 @@ public class PowerJobAutoConfiguration {
* Max length of appended workflow context . Appended workflow context value that is longer than the value will be ignore.
*/
config.setMaxAppendedWfContextLength(worker.getMaxAppendedWfContextLength());
/*
* Worker Tag
*/
config.setTag(worker.getTag());
/*
* Create OhMyWorker object and set properties.
*/

View File

@ -90,6 +90,16 @@ public class PowerJobProperties {
getWorker().setEnableTestMode(enableTestMode);
}
@Deprecated
@DeprecatedConfigurationProperty(replacement = "powerjob.worker.tag")
public String getTag() {
return getWorker().tag;
}
@Deprecated
public void setTag(String tag) {
getWorker().setTag(tag);
}
/**
* Powerjob worker configuration properties.
@ -139,6 +149,9 @@ public class PowerJobProperties {
* {@link WorkflowContext} max length for #appendedContextData
*/
private int maxAppendedWfContextLength = 8192;
/**
* Worker Tag
*/
private String tag;
}
}

View File

@ -56,6 +56,12 @@
"type": "java.lang.Integer",
"description": "Max length of appended workflow context. Appended workflow context that is longer than the value will be ignore.",
"sourceType": "tech.powerjob.worker.autoconfigure.PowerJobProperties$Worker"
},
{
"name": "powerjob.worker.tag",
"type": "java.lang.String",
"description": "Worker Tag",
"sourceType": "tech.powerjob.worker.autoconfigure.PowerJobProperties$Worker"
}
],
"hints": []