Skip to content

feat(scheduler): add a countdown to the next scheduler run - #379

Open
renada-jacob wants to merge 1 commit into
CyberDrain:devfrom
Renada-Solutions:feat/scheduler-next-run-countdown
Open

feat(scheduler): add a countdown to the next scheduler run#379
renada-jacob wants to merge 1 commit into
CyberDrain:devfrom
Renada-Solutions:feat/scheduler-next-run-countdown

Conversation

@renada-jacob

Copy link
Copy Markdown
Contributor

The scheduler page shows scheduled tasks in relative time, a task where the scheduled time has passed for example shows "3 minutes ago" with the state of "Planned" which to an unexperienced CIPP user reads as overdue or a problem with CIPP - when in reality it missed the last orchestrator run by a small margin.. I know this causes no end of confusion for MSPs and even myself at times..

This PR aims to address these issues by adding a tile above the Scheduled Tasks table showing the following:

  • how long until the next scheduler run
  • the time that run is due
  • how many of the listed tasks that run will pick up
  • how many tasks are already being worked on
image

Scheduled Time renders as relative time, so a task whose time has passed reads
"3 minutes ago" while its state is still Planned. That reads as overdue when the
task is only waiting for the next orchestrator pass.

Adds a tile above the Scheduled Tasks table showing the time remaining until the
next run, the time it is due, how many of the listed tasks that run will pick up,
and how many are already being worked on.

The cadence is derived client-side from the fixed Start-UserTasksOrchestrator
cron (0 */15 * * * *). Every IANA UTC offset is a whole multiple of 15 minutes,
so those boundaries land on the same instants in the browser's local clock. The
counts subscribe to the query cache the table already populates, so they cost no
extra request and follow the Show System Jobs toggle.

The two counts are reported separately because they mean different things. Once
an orchestrator claims a task it leaves Planned for Pending, so it stops being
due; counting only what is due left a claimed task showing alongside a bare "no
tasks due", which reads as though nothing is happening.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant