I have this code here
# it's not every five mins but let's overlook that for now
@periodic_task(crontab(minute='*/1'))
def every_five_mins():
# ...
But I couldn't find where Huey calls the function. The only other place that I've used Huey is in settings.py
but still I only included
HUEY = {
'huey_class': 'huey.RedisHuey',
'name': DATABASES['default']['NAME'],
'results': True,
'store_none': False,
'immediate': False,
'utc': True,
'blocking': True,
'connection': {
'host': 'localhost',
'port': 6379,
'db': 0,
'connection_pool': None,
'read_timeout': 1,
'url': None,
},
'consumer': {
'workers': 1,
'worker_type': 'thread',
'initial_delay': 0.1,
'backoff': 1.15,
'max_delay': 10.0,
'scheduler_interval': 1,
'periodic': True,
'check_worker_health': True,
'health_check_interval': 1,
},
}
Can anyone please tell me how a task is executed? I want to know this because I want to pass in parameters into every_five_mins()
, e.g., every_five_mins(argument1=argument1)
but I can't do that without knowing where the function is called (otherwise argument1 is going to raise an undefined error).
Thanks in advance.