mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-29 19:35:56 +00:00
fix(error-apps): reset apps in error state (#19052)
This commit is contained in:
parent
efbdf21098
commit
6fab88a3d1
@ -38,6 +38,7 @@ import org.quartz.Trigger;
|
||||
import org.quartz.TriggerBuilder;
|
||||
import org.quartz.TriggerKey;
|
||||
import org.quartz.impl.StdSchedulerFactory;
|
||||
import org.quartz.impl.matchers.GroupMatcher;
|
||||
|
||||
@Slf4j
|
||||
public class AppScheduler {
|
||||
@ -93,10 +94,32 @@ public class AppScheduler {
|
||||
.getListenerManager()
|
||||
.addJobListener(new OmAppJobListener(dao), jobGroupEquals(APPS_JOB_GROUP));
|
||||
|
||||
this.resetErrorTriggers();
|
||||
|
||||
// Start Scheduler
|
||||
this.scheduler.start();
|
||||
}
|
||||
|
||||
private void resetErrorTriggers() {
|
||||
try {
|
||||
scheduler
|
||||
.getTriggerKeys(GroupMatcher.anyGroup())
|
||||
.forEach(
|
||||
triggerKey -> {
|
||||
try {
|
||||
if (scheduler.getTriggerState(triggerKey) == Trigger.TriggerState.ERROR) {
|
||||
LOG.info("Resetting trigger {} from error state", triggerKey);
|
||||
scheduler.resetTriggerFromErrorState(triggerKey);
|
||||
}
|
||||
} catch (SchedulerException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
});
|
||||
} catch (SchedulerException ex) {
|
||||
LOG.error("Failed to reset failed triggers", ex);
|
||||
}
|
||||
}
|
||||
|
||||
public static void initialize(
|
||||
OpenMetadataApplicationConfig config, CollectionDAO dao, SearchRepository searchClient)
|
||||
throws SchedulerException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user