How can I prevent rufus-scheduler from accruing a backlog of tasks when my computer is in standby?

StackOverflow https://stackoverflow.com/questions/18861517

  •  29-06-2022
  •  | 
  •  

Question

I recently started running a Dashing application locally on my laptop. Rufus-scheduler handles the scheduling of the jobs that update the dashboard. I have a job scheduled to run every minute. The job spawns another process and captures the output. When I shut the lid of my laptop for a few hours, and open the lid again, I can barely use the laptop, because hundreds of processes have started up and consumed all my RAM and several gigabytes of swap. They eventually finish over the next several minutes, and I can resume using my laptop normally.

How can I configure my jobs to not be scheduled when the computer is sleeping? Or is there a better way to avoid this problem?

Was it helpful?

Solution

Multiple solutions.

a) with rufus-scheduler 2.x, use :discard_past => true (https://github.com/jmettraux/rufus-scheduler/blob/two/README.rdoc#every-jobs-and-first_at--first_in last sentence)

b) don't use dashing on a laptop

c) use rufus-scheduler 3.x, which, by default, doesn't schedule in the past

OTHER TIPS

It looks like according to the rufus-scheduler 2.0.x documentation, I can use scheduler.cron (maybe in combination with blocking => true option) instead of scheduler.every so that missed jobs won't fire in the future once the scheduler process is free.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top