Skip to content

Commit f34f903

Browse files
committed
docs: translate OhMyConfig
1 parent 5feaf61 commit f34f903

File tree

3 files changed

+22
-18
lines changed

3 files changed

+22
-18
lines changed

powerjob-worker-spring-boot-starter/src/main/java/com/github/kfcfans/powerjob/worker/autoconfigure/PowerJobProperties.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,7 @@ public static class Worker {
130130
private int maxResultLength = 8096;
131131
/**
132132
* If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName.
133-
* Test mode is used for conditions that your worker does not need to run the codes, i.e. when you
134-
* write junit tests in local environment. {@code true} means test mode is enabled. {@code false} means
135-
* normal mode is applied.
133+
* Test mode is used for conditions that your have no powerjob-server in your develop env so you can't startup the application
136134
*/
137135
private boolean enableTestMode = false;
138136
}

powerjob-worker/src/main/java/com/github/kfcfans/powerjob/worker/common/OhMyConfig.java

+18-14
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import java.util.List;
1111

1212
/**
13-
* Worker 配置文件
13+
* The powerjob-worker's configuration
1414
*
1515
* @author tjq
1616
* @since 2020/3/16
@@ -19,34 +19,38 @@
1919
@Setter
2020
public class OhMyConfig {
2121
/**
22-
* 应用名称
22+
* AppName, recommend to use the name of this project
23+
* Applications should be registered by powerjob-console in advance to prevent error.
2324
*/
2425
private String appName;
2526
/**
26-
* 启动端口
27+
* Worker port
28+
* Random port is enabled when port is set with non-positive number.
2729
*/
2830
private int port = RemoteConstant.DEFAULT_WORKER_PORT;
2931
/**
30-
* 调度服务器地址,ip:port 或 域名
32+
* Address of powerjob-server node(s)
33+
* Do not mistake for ActorSystem port. Do not add any prefix, i.e. http://.
3134
*/
3235
private List<String> serverAddress = Lists.newArrayList();
3336
/**
34-
* 本地持久化方式,默认使用磁盘
35-
*/
36-
private StoreStrategy storeStrategy = StoreStrategy.DISK;
37-
/**
38-
* 最大返回值长度,超过会被截断
39-
* {@link ProcessResult}#msg 的最大长度
37+
* Max length of response result. Result that is longer than the value will be truncated.
38+
* {@link ProcessResult} max length for #msg
4039
*/
4140
private int maxResultLength = 8096;
4241
/**
43-
* 用户自定义上下文对象,该值会被透传到 TaskContext#userContext 属性
44-
* 使用场景:容器脚本Java处理器需要使用oms-worker宿主应用的Spring Bean,可在此处传入 ApplicationContext,在Processor中获取 bean
42+
* User-defined context object, which is passed through to the TaskContext#userContext property
43+
* Usage Scenarios: The container Java processor needs to use the Spring bean of the host application, where you can pass in the ApplicationContext and get the bean in the Processor
4544
*/
4645
private Object userContext;
4746
/**
48-
* 启动测试模式,true情况下,不再尝试连接 server 并验证appName
49-
* true -> 用于本地写单元测试调试; false -> 默认值,标准模式
47+
* Internal persistence method, DISK or MEMORY
48+
* Normally you don't need to care about this configuration
49+
*/
50+
private StoreStrategy storeStrategy = StoreStrategy.DISK;
51+
/**
52+
* If test mode is set as true, Powerjob-worker no longer connects to the server or validates appName.
53+
* Test mode is used for conditions that your have no powerjob-server in your develop env so you can't startup the application
5054
*/
5155
private boolean enableTestMode = false;
5256
}
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
package com.github.kfcfans.powerjob.worker.common.constants;
22

33
import lombok.AllArgsConstructor;
4+
import lombok.Getter;
45

56
/**
67
* 持久化策略
78
*
89
* @author tjq
910
* @since 2020/4/14
1011
*/
12+
@Getter
1113
@AllArgsConstructor
1214
public enum StoreStrategy {
1315

1416
DISK("磁盘"),
1517
MEMORY("内存");
1618

17-
private String des;
19+
private final String des;
1820
}

0 commit comments

Comments
 (0)