Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

优化的同步数据源的结构信息的时候,排除掉数据源已经在回收站中的 #2359

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
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