diff --git a/python/tasks/tiktok/celery.py b/python/tasks/tiktok/celery.py index bbccb68..5feab9c 100644 --- a/python/tasks/tiktok/celery.py +++ b/python/tasks/tiktok/celery.py @@ -1,6 +1,7 @@ from .config import tiktok_config from .utils import kombu_register_json_dataclass, Backend +import logging import celery import redis @@ -20,6 +21,7 @@ app = celery.Celery( kombu_register_json_dataclass() app._backend = Backend(app=app, url=c.celery_result_backend) +app.log.setup(loglevel=logging.INFO) app.autodiscover_tasks(c.celery_imports) diff --git a/python/tasks/tiktok/tasks.py b/python/tasks/tiktok/tasks.py index 9d98b3d..4832e0b 100644 --- a/python/tasks/tiktok/tasks.py +++ b/python/tasks/tiktok/tasks.py @@ -218,14 +218,14 @@ def tiktok_videos_fetch( force ): try: - tiktok_video_fetch.apply_async( + tiktok_video_fetch.s( id=o['id'], url=o['url'], fname=o['fname'], method=method, method_str=method_str, result_dir=o['result_dir'], - ).wait() + ).apply_async().get(disable_sync_subtasks=False,) stats['saved'] += 1 except KeyboardInterrupt: break