I created a celery shared_task
which executes another shared_task
:
@shared_task(base=WorkerBase,
name='analytics.worker-tenant',
rate_limit='3/m')
def worker_tenant():
tenants = Tenant.objects.values_list('id', 'contexttenant')
print('first:worker_tenant')
for tenant in tenants:
worker_update_tenant.delay(tenant[0], tenant[1])
@shared_task(name='analytics.worker-update-tenant',
autoretry_for=(HTTPError, ConnectionError),
retry_backoff=True)
def worker_update_tenant(id, context, timespan=timedelta(weeks=1)):
print('worker_update_tenant')
I get the output of the first print first:worker_tenant
but not the second one worker_update_tenant
.
I have also tried to call the second task with apply_async(args=(...))
but that also didn't work!