Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save giridharmb/15d715f3c6c0e4c2db9b359de18467cc to your computer and use it in GitHub Desktop.

Select an option

Save giridharmb/15d715f3c6c0e4c2db9b359de18467cc to your computer and use it in GitHub Desktop.
using rq scheduler
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