Skip to content

Commit

Permalink
type annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
jokester committed Feb 29, 2024
1 parent 2d422e8 commit cd952a4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/tasks/import_from_labelplus.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from celery.utils.log import get_task_logger
from app.utils.labelplus import load_from_labelplus
from app.constants.source import SourcePositionType
from celery.result import AsyncResult

logger = get_task_logger(__name__)

Expand Down Expand Up @@ -99,7 +100,7 @@ def import_from_labelplus_task(project_id):
return f"成功:Project {project_id}"


def import_from_labelplus(project_id, /, *, run_sync=False):
def import_from_labelplus(project_id, /, *, run_sync=False) -> SyncResult | AsyncResult:
alive_workers = celery.control.ping()
if len(alive_workers) == 0 or run_sync:
# 同步执行
Expand Down

0 comments on commit cd952a4

Please sign in to comment.