Skip to content
Snippets Groups Projects
Verified Commit 2c31d211 authored by Antoine R. Dumont's avatar Antoine R. Dumont
Browse files

Use @shared_task decorator instead of binding to specific celery app

parent 5dfbeac8
No related branches found
No related tags found
1 merge request!40Migrate most deposit tests to pytest
# Copyright (C) 2015-2018 The Software Heritage developers # Copyright (C) 2015-2019 The Software Heritage developers
# See the AUTHORS file at the top-level directory of this distribution # See the AUTHORS file at the top-level directory of this distribution
# License: GNU General Public License version 3, or any later version # License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information # See top-level LICENSE file for more information
from celery import current_app as app from celery import shared_task
from swh.deposit.loader.loader import DepositLoader from swh.deposit.loader.loader import DepositLoader
from swh.deposit.loader.checker import DepositChecker from swh.deposit.loader.checker import DepositChecker
@app.task(name=__name__ + '.LoadDepositArchiveTsk') @shared_task(name=__name__ + '.LoadDepositArchiveTsk')
def load_deposit_archive(archive_url, deposit_meta_url, deposit_update_url): def load_deposit_archive(archive_url, deposit_meta_url, deposit_update_url):
"""Deposit archive loading task described by the following steps: """Deposit archive loading task described by the following steps:
...@@ -27,7 +27,7 @@ def load_deposit_archive(archive_url, deposit_meta_url, deposit_update_url): ...@@ -27,7 +27,7 @@ def load_deposit_archive(archive_url, deposit_meta_url, deposit_update_url):
deposit_update_url=deposit_update_url) deposit_update_url=deposit_update_url)
@app.task(name=__name__ + '.ChecksDepositTsk') @shared_task(name=__name__ + '.ChecksDepositTsk')
def check_deposit(deposit_check_url): def check_deposit(deposit_check_url):
"""Check a deposit's status """Check a deposit's status
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment