question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to not remove jobs on completion

See original GitHub issue

Is your feature request related to a problem? Please describe. Hi. In my app, I am giving users the option to run any particular job as recurring or just run it once. Regardless of job schedule, I am keeping track of all executions in a separate table. In order to do this, I have to call apscheduler.get_job during EVENT_JOB_EXECUTED. Unfortunately, when the job is run once, it is removed from the database before I can make that call to get details about the execution, making it impossible for me to store information about the result.

Describe the solution you’d like I would like an option for the scheduler to not remove jobs on completion of single run events. Maybe give it a status of “COMPLETE” or something. That way, it’s still clear to APScheduler that a job was run at some point, event though it won’t have to handle it anymore.

Alternatively, it might be more generally useful to pass the entire Job during the event lifecycle. This might be a lot slower for people with a bunch of jobs though.

Describe alternatives you’ve considered Because I am also storing the output of the executions, I haven’t found a way to grab the return string in any other way but through the JobExecutionEvent.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
agronholmcommented, Mar 13, 2021

I think your use case is valid but I would look into modifying the job completion event so that it contains all the necessary information.

0reactions
daddycocoamancommented, Mar 13, 2021

I agree! In the meantime, I’ve just subclassed the scheduler I’m using and added additional logic to handle single run events. Thanks for the consideration.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solved: Ability to hide or delete past jobs - Upwork Community
Solved: I need to have the ablity to hide or delete closed jobs. ... your completed jobs to private by clicking on "Make...
Read more >
How to remove/hide jobs from "Completed Jobs" window?
- Select <CRLT> + <shift> + <X > keys at the same time to open the 'Enable Specials Features' window. If the feature...
Read more >
How to automatically remove completed Kubernetes Jobs ...
You can now set history limits, or disable history altogether, so that failed or successful CronJobs are not kept around indefinitely. See my...
Read more >
Jobs | Kubernetes
As pods successfully complete, the Job tracks the successful completions. ... Suspending a Job will delete its active Pods until the Job is...
Read more >
What To Do When You Receive a Position Eliminated Letter
Position eliminated means the company you work for is removing your role and its responsibilities. Typically when this occurs, employers ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found