mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-31 04:14:34 +00:00
Keep Status ActiveError on Job Run (#17515)
This commit is contained in:
parent
d59473f718
commit
dc10b38b77
@ -142,8 +142,6 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
||||
|
||||
// Run ReIndexing
|
||||
performReindex(jobExecutionContext);
|
||||
// Mark Job as Completed
|
||||
updateJobStatus();
|
||||
} catch (Exception ex) {
|
||||
IndexingError indexingError =
|
||||
new IndexingError()
|
||||
@ -153,7 +151,7 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
||||
"Reindexing Job Has Encountered an Exception. %n Job Data: %s, %n Stack : %s ",
|
||||
jobData.toString(), ExceptionUtils.getStackTrace(ex)));
|
||||
LOG.error(indexingError.getMessage());
|
||||
jobData.setStatus(EventPublisherJob.Status.FAILED);
|
||||
jobData.setStatus(EventPublisherJob.Status.ACTIVE_ERROR);
|
||||
jobData.setFailure(indexingError);
|
||||
} finally {
|
||||
// Send update
|
||||
@ -257,7 +255,7 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
||||
}
|
||||
|
||||
} catch (SearchIndexException rx) {
|
||||
jobData.setStatus(EventPublisherJob.Status.FAILED);
|
||||
jobData.setStatus(EventPublisherJob.Status.ACTIVE_ERROR);
|
||||
jobData.setFailure(rx.getIndexingError());
|
||||
paginatedSource.updateStats(
|
||||
rx.getIndexingError().getSuccessCount(), rx.getIndexingError().getFailedCount());
|
||||
@ -396,18 +394,6 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
||||
searchRepository.createIndex(indexType);
|
||||
}
|
||||
|
||||
private void updateJobStatus() {
|
||||
if (stopped) {
|
||||
jobData.setStatus(EventPublisherJob.Status.STOPPED);
|
||||
} else {
|
||||
if (jobData.getFailure() != null) {
|
||||
jobData.setStatus(EventPublisherJob.Status.FAILED);
|
||||
} else {
|
||||
jobData.setStatus(EventPublisherJob.Status.COMPLETED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void stopJob() {
|
||||
stopped = true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user