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.

How can I stop periodic task?

See original GitHub issue

I can start periodic task by running myfun(repeat=60) but what is the right way to stop it?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7

github_iconTop GitHub Comments

4reactions
soekarmanacommented, Jul 14, 2020

for anyone who still got problem with this to stop periodic task from running, just delete it from database with :

Task.objects.get(task_hash=the_task_hash).delete()

poof, gone! why using task_hash? : because id changed every time it repeats, but task_hash does not plus with this no need to restart manage.py process_tasks process

1reaction
walterrennercommented, May 31, 2017

Hi @chapkovski Periodic tasks can best stopped by deleted them from the Database.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do we completed stop tasks in celery periodic_task?
One possible way is to store the tasks in the database and add remove tasks dynamically. You can use database backed celery beat...
Read more >
Stopping a periodic task? - Klei Entertainment Forums
When you try to cancel it, make sure "inst" is still the very same object and the task is still saved in inst.task....
Read more >
How to Disable Scheduled Tasks in Windows 10 - MakeUseOf
To disable a scheduled task, launch Command Prompt as administrator and type schtasks /Change /TN "<Task Folder Path>\<Task Name>" /Disable.
Read more >
How to dynamically add / remove periodic tasks
Just replying since I found a solution for this. When you're deleting a Periodic Task, first set it's enabled property to false FIRST....
Read more >
Disable-ScheduledTask - Microsoft Learn
Examples · Example 1: Disable a scheduled task · Example 2: Disable all scheduled tasks in a folder.
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