mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
Fix acknowledging some system job returning error. (#24860)
* use jobId to remove acknowledged job * fix lint * add changelog * Update SystemJobsStore.js --------- Co-authored-by: Mohamed OULD HOCINE <106236152+gally47@users.noreply.github.com>
This commit is contained in:
5
changelog/unreleased/pr-24860.toml
Normal file
5
changelog/unreleased/pr-24860.toml
Normal file
@@ -0,0 +1,5 @@
|
||||
type = "fixed"
|
||||
message = "Fix App Owner: Acknowledging a restored archive job shows error."
|
||||
|
||||
issues = ["Graylog2/graylog-plugin-enterprise#10888"]
|
||||
pulls = ["24860"]
|
||||
@@ -61,7 +61,8 @@ export const SystemJobsStore = singletonStore('core.SystemJobs', () =>
|
||||
},
|
||||
() => {
|
||||
// If we get an error (probably 404 because the job is gone), remove the job from the cache and trigger an update.
|
||||
const { [jobId]: currentJob, ...rest } = this.jobsById;
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const { [jobId]: _, ...rest } = this.jobsById;
|
||||
|
||||
this.jobsById = rest;
|
||||
this.trigger({ jobsById: this.jobsById });
|
||||
@@ -72,8 +73,8 @@ export const SystemJobsStore = singletonStore('core.SystemJobs', () =>
|
||||
},
|
||||
acknowledgeJob(jobId) {
|
||||
const url = URLUtils.qualifyUrl(ApiRoutes.SystemJobsApiController.acknowledgeJob(jobId).url);
|
||||
const promise = fetch('DELETE', url).then((response) => {
|
||||
delete this.jobsById[response.id];
|
||||
const promise = fetch('DELETE', url).then(() => {
|
||||
delete this.jobsById[jobId];
|
||||
});
|
||||
|
||||
SystemJobsActions.acknowledgeJob.promise(promise);
|
||||
|
||||
Reference in New Issue
Block a user