Create a composable and update task polling #13093
Labels
DEV: frontend
javascript
Pull requests that update Javascript code
P0 - critical
Priority: Release blocker or regression
Milestone
Create a composable in kolibri-common for doing task polling.
It should use a similar pattern that Blaine has implemented elsewhere, where it includes a mounted counter, so it gets torn down when all mounted instances have been destroyed that were using it, but otherwise reuses the same polling.
If multiple components consuming it, it shouldn't be initialized multiple times.
This should use useTimeoutPoll from vueuse (or equivalent). This will mean - we don't setup multiple setIntervals, and we only ever poll again when the previous poll has finished.
The only caveat here might be if we are polling tasks with different queues, we should make sure to uniqueify these polls.
Then, replace any instances of
setInterval
for task polling with this.The text was updated successfully, but these errors were encountered: