mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-10-18 20:30:48 +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
|
// Run ReIndexing
|
||||||
performReindex(jobExecutionContext);
|
performReindex(jobExecutionContext);
|
||||||
// Mark Job as Completed
|
|
||||||
updateJobStatus();
|
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
IndexingError indexingError =
|
IndexingError indexingError =
|
||||||
new 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 ",
|
"Reindexing Job Has Encountered an Exception. %n Job Data: %s, %n Stack : %s ",
|
||||||
jobData.toString(), ExceptionUtils.getStackTrace(ex)));
|
jobData.toString(), ExceptionUtils.getStackTrace(ex)));
|
||||||
LOG.error(indexingError.getMessage());
|
LOG.error(indexingError.getMessage());
|
||||||
jobData.setStatus(EventPublisherJob.Status.FAILED);
|
jobData.setStatus(EventPublisherJob.Status.ACTIVE_ERROR);
|
||||||
jobData.setFailure(indexingError);
|
jobData.setFailure(indexingError);
|
||||||
} finally {
|
} finally {
|
||||||
// Send update
|
// Send update
|
||||||
@ -257,7 +255,7 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} catch (SearchIndexException rx) {
|
} catch (SearchIndexException rx) {
|
||||||
jobData.setStatus(EventPublisherJob.Status.FAILED);
|
jobData.setStatus(EventPublisherJob.Status.ACTIVE_ERROR);
|
||||||
jobData.setFailure(rx.getIndexingError());
|
jobData.setFailure(rx.getIndexingError());
|
||||||
paginatedSource.updateStats(
|
paginatedSource.updateStats(
|
||||||
rx.getIndexingError().getSuccessCount(), rx.getIndexingError().getFailedCount());
|
rx.getIndexingError().getSuccessCount(), rx.getIndexingError().getFailedCount());
|
||||||
@ -396,18 +394,6 @@ public class SearchIndexApp extends AbstractNativeApplication {
|
|||||||
searchRepository.createIndex(indexType);
|
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() {
|
public void stopJob() {
|
||||||
stopped = true;
|
stopped = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user