From 6561c314183d28df46e802d22836b89d8123325f Mon Sep 17 00:00:00 2001 From: Ponfee Date: Sun, 4 Feb 2024 17:52:06 +0800 Subject: [PATCH] optimize code --- .../ponfee/disjob/samples/worker/WorkerFramelessMain.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/disjob-samples/disjob-samples-frameless-worker/src/main/java/cn/ponfee/disjob/samples/worker/WorkerFramelessMain.java b/disjob-samples/disjob-samples-frameless-worker/src/main/java/cn/ponfee/disjob/samples/worker/WorkerFramelessMain.java index d0833347f..2891f90c6 100644 --- a/disjob-samples/disjob-samples-frameless-worker/src/main/java/cn/ponfee/disjob/samples/worker/WorkerFramelessMain.java +++ b/disjob-samples/disjob-samples-frameless-worker/src/main/java/cn/ponfee/disjob/samples/worker/WorkerFramelessMain.java @@ -78,9 +78,12 @@ public static void main(String[] args) throws Exception { String group = props.getString(WORKER_KEY_PREFIX + ".group"); Assert.hasText(group, "Worker group name cannot empty."); - String boundHost = JobUtils.getLocalHost(props.getString(DISJOB_BOUND_SERVER_HOST)); + String host = JobUtils.getLocalHost(props.getString(DISJOB_BOUND_SERVER_HOST)); + String workerToken = workerProperties.getWorkerToken(); + String supervisorToken = workerProperties.getSupervisorToken(); + String supervisorContextPath = workerProperties.getSupervisorContextPath(); - Object[] array = {group, UuidUtils.uuid32(), boundHost, port, workerProperties.getWorkerToken(), workerProperties.getSupervisorToken()}; + Object[] array = {group, UuidUtils.uuid32(), host, port, workerToken, supervisorToken, supervisorContextPath}; Worker.Current currentWorker = ClassUtils.invoke(Class.forName(Worker.Current.class.getName()), "create", array); TimingWheel timingWheel = new TaskTimingWheel(