Created
June 6, 2023 12:16
-
-
Save voith/66c82bd73c22af8d421f29939fed9e33 to your computer and use it in GitHub Desktop.
Script to run redbeat tasks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import namedtuple | |
from rebate_program.celery import app # get the celery app object from your project | |
from redbeat.schedulers import RedBeatScheduler, acquire_distributed_beat_lock | |
beat = RedBeatScheduler(app) | |
Sender = namedtuple('sender', ['scheduler']) | |
sender = Sender(beat) | |
acquire_distributed_beat_lock(sender) | |
print(beat.schedule) | |
# run schduler taks | |
beat.tick() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment