[~] Refactor
This commit is contained in:
parent
3a7ed25c08
commit
8083545b90
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user