Created
September 4, 2021 06:58
-
-
Save pratik-choudhari/17f4cd0828be0a6bb89e8601ebba5b3f to your computer and use it in GitHub Desktop.
using rq scheduler
This file contains hidden or 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 rq_scheduler import Scheduler | |
| queue = Queue('circle', connection=Redis()) | |
| scheduler = Scheduler(queue=queue) | |
| scheduler.schedule( | |
| scheduled_time=datetime.utcnow(), # Time for first execution, in UTC timezone | |
| func=func, # Function to be queued | |
| args=[arg1, arg2], # Arguments passed into function when executed | |
| kwargs={'foo': 'bar'}, # Keyword arguments passed into function when executed | |
| interval=60, # Time before the function is called again, in seconds | |
| repeat=None, # Repeat this number of times (None means repeat forever) | |
| meta={'foo': 'bar'} # Arbitrary pickleable data on the job itself | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment