Skip to content
Open
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
6 changes: 4 additions & 2 deletions server/src/main/java/datart/server/job/SchemaSyncJob.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
package datart.server.job;

import com.fasterxml.jackson.databind.ObjectMapper;
import datart.core.base.consts.Const;
import datart.core.common.Application;
import datart.core.common.TransactionHelper;
import datart.core.common.UUIDGenerator;
Expand All @@ -41,6 +42,7 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.Objects;

@Slf4j
public class SchemaSyncJob implements Job, Closeable {
Expand All @@ -62,8 +64,8 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
source = Application.getBean(SourceService.class).retrieve(sourceId, false);
} catch (Exception ignored) {
}
// remove job if source not exists
if (source == null) {
// remove job if source not exists or status is archived
if (source == null || Objects.equals(Const.DATA_STATUS_ARCHIVED, source.getStatus())) {
JobKey key = context.getJobDetail().getKey();
Application.getBean(Scheduler.class).deleteJob(key);
log.warn("source {} not exists , the job has been deleted ", sourceId);
Expand Down
Loading