Skip to content

Commit 3454487

Browse files
kowalczyk-krzysztofqn895
authored andcommitted
Fix unusedUrlsCLeanupTask run interval not updating on change (elastic#231883)
## Summary This PR fixes a bug where the schedule interval of unused URLs cleanup task wouldn't update when config changes. Closes: elastic#231775
1 parent 81e6ac3 commit 3454487

File tree

1 file changed

+4
-0
lines changed
  • src/platform/plugins/shared/share/server/unused_urls_task

1 file changed

+4
-0
lines changed

src/platform/plugins/shared/share/server/unused_urls_task/task.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ export const scheduleUnusedUrlsCleanupTask = async ({
180180

181181
const taskInstance = getDeleteUnusedUrlTaskInstance(checkInterval);
182182
await taskManager.ensureScheduled(taskInstance);
183+
// TODO: Workaround for interval not updating on change until https://github.com/elastic/kibana/issues/222089 is resolved.
184+
await taskManager.bulkUpdateSchedules([TASK_ID], {
185+
interval: durationToSeconds(checkInterval),
186+
});
183187
} catch (e) {
184188
throw new Error(e.message || 'Failed to schedule unused URLs cleanup task');
185189
}

0 commit comments

Comments
 (0)