Skip to content

Instantly share code, notes, and snippets.

@romank0
Created November 15, 2017 11:05
Show Gist options
  • Save romank0/8fae4c710d5996918cd9b651d858ee6e to your computer and use it in GitHub Desktop.
Save romank0/8fae4c710d5996918cd9b651d858ee6e to your computer and use it in GitHub Desktop.
long running task
@task(routing_key="low_priority", queue="low_priority", acks_late=True)
def long_running():
import os
from time import sleep
while not os.path.isfile('/Users/romanko/stop'):
logger.info('no file: waiting 5 seconds')
sleep(5)
logger.info('file exists: exiting')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment