diff --git a/hub/graphql/mutations.py b/hub/graphql/mutations.py index 180f11797..b90f46d40 100644 --- a/hub/graphql/mutations.py +++ b/hub/graphql/mutations.py @@ -68,10 +68,7 @@ def disable_auto_update (external_data_source_id: str) -> models.ExternalDataSou @strawberry.mutation(extensions=[IsAuthenticated()]) def trigger_update(external_data_source_id: str) -> models.ExternalDataSource: data_source = models.ExternalDataSource.objects.get(id=external_data_source_id) - # TODO: Return this to the queue - print("Triggering update") - async_to_sync(data_source.refresh_all)() - # job_id = data_source.schedule_refresh_all() + job_id = data_source.schedule_refresh_all() return data_source @strawberry.mutation(extensions=[IsAuthenticated()]) diff --git a/hub/tasks.py b/hub/tasks.py index 7cf1889f6..14c9a9565 100644 --- a/hub/tasks.py +++ b/hub/tasks.py @@ -23,7 +23,7 @@ async def refresh_all(external_data_source_id: str): # Refresh webhooks once a day @app.periodic(cron="0 3 * * *") @app.task(queue="index") -async def refresh_webhooks(external_data_source_id: str): +async def refresh_webhooks(external_data_source_id: str, timestamp): from hub.models import ExternalDataSource await ExternalDataSource.deferred_refresh_webhooks(external_data_source_id=external_data_source_id)