Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spring-cloud-alibaba-dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<!-- scheduling -->
<shedlock.version>4.23.0</shedlock.version>
<schedulerx.worker.version>1.11.4</schedulerx.worker.version>
<schedulerx.worker.version>1.13.1</schedulerx.worker.version>

<!-- Maven Plugin Versions -->
<maven-source-plugin.version>3.2.1</maven-source-plugin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public NoOpScheduler noOpScheduler() {

@Bean
public SchedulerxSchedulingConfigurer schedulerxSchedulingConfigurer() {
return new SchedulerxSchedulingConfigurer();
return new SchedulerxSchedulingConfigurer(noOpScheduler(), true);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public class SchedulerxProperties implements InitializingBean {
*/
private String label;

private String labelPath = "/etc/podinfo/annotations";
private String labelPath = "/etc/podinfo/labels";

/**
* enableCgroupMetrics.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,12 +102,17 @@ public synchronized void syncJobs(Map<String, JobProperty> jobs, String namespac
for (Entry<String, JobProperty> entry : jobs.entrySet()) {
String jobName = entry.getKey();
JobProperty jobProperty = entry.getValue();
JobConfigInfo jobConfigInfo = getJob(client, jobName, namespaceSource);
if (jobConfigInfo == null) {
createJob(client, jobName, jobProperty, namespaceSource);
try {
JobConfigInfo jobConfigInfo = getJob(client, jobName, namespaceSource);
if (jobConfigInfo == null) {
createJob(client, jobName, jobProperty, namespaceSource);
}
else if (jobProperty.isOverwrite()) {
updateJob(client, jobConfigInfo, jobProperty, namespaceSource);
}
}
else if (jobProperty.isOverwrite()) {
updateJob(client, jobConfigInfo, jobProperty, namespaceSource);
catch (Exception e) {
logger.error("sync job {} failed. jobProperty:{}", jobName, JsonUtil.toJson(jobProperty), e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import com.alibaba.schedulerx.worker.domain.SpringScheduleProfile;
import com.alibaba.schedulerx.worker.log.LogFactory;
import com.alibaba.schedulerx.worker.log.Logger;
import com.alibaba.schedulerx.worker.processor.springscheduling.SchedulerxSchedulingConfigurer;
import com.alibaba.schedulerx.worker.processor.springscheduling.SchedulerxJobRegister;

import org.springframework.aop.framework.AopProxyUtils;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -64,9 +64,6 @@ public class ScheduledJobSyncConfigurer implements SchedulingConfigurer {
@Autowired
private SchedulerxProperties properties;

@Autowired
private SchedulerxSchedulingConfigurer schedulerxSchedulingConfigurer;

@Value("${" + SchedulerxProperties.CONFIG_PREFIX + ".task-overwrite:false}")
private Boolean overwrite = false;

Expand Down Expand Up @@ -175,7 +172,7 @@ public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
}

// 获取仅SchedulerX注解任务
Collection<Pair<Object, Method>> schedulerXTasks = schedulerxSchedulingConfigurer.getSchedulerXTaskTargets();
Collection<Pair<Object, Method>> schedulerXTasks = SchedulerxJobRegister.getInstance().getSchedulerXTaskTargets();
if (schedulerXTasks != null && schedulerXTasks.size() > 0) {
for (Pair<Object, Method> task : schedulerXTasks) {
JobProperty jobProperty = convertToJobProperty(null, task.getFirst(), task.getSecond());
Expand Down
Loading