Skip to content

Commit 9f2c7fc

Browse files
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 bcbacb6 commit 9f2c7fc

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • src/platform/plugins/shared/share/server/unused_urls_task

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)