Skip to content
Snippets Groups Projects
Commit eb60bf5d authored by Nicolas Dandrimont's avatar Nicolas Dandrimont
Browse files

Revert "deposit.signals: Scheduler load-deposit task with new endpoints"

This reverts commit 12e3966b.
parent 9b65a13d
No related branches found
No related tags found
1 merge request!42Revert "deposit.signals: Scheduler load-deposit task with new endpoints"
......@@ -13,8 +13,6 @@
"""
from swh.deposit import utils
from django.db.models.signals import post_save
from django.dispatch import receiver
......@@ -93,11 +91,18 @@ def post_deposit_save(sender, instance, created, raw, using,
elif (instance.status == DEPOSIT_STATUS_VERIFIED and
not instance.load_task_id):
url = utils.origin_url_from(instance)
task = create_oneshot_task_dict(
'load-deposit', url=url, deposit_id=instance.id)
# schedule deposit loading
from swh.deposit.config import PRIVATE_GET_RAW_CONTENT
from swh.deposit.config import PRIVATE_GET_DEPOSIT_METADATA
from swh.deposit.config import PRIVATE_PUT_DEPOSIT
archive_url = reverse(PRIVATE_GET_RAW_CONTENT, args=args)
meta_url = reverse(PRIVATE_GET_DEPOSIT_METADATA, args=args)
update_url = reverse(PRIVATE_PUT_DEPOSIT, args=args)
task = create_oneshot_task_dict('load-deposit',
archive_url=archive_url,
deposit_meta_url=meta_url,
deposit_update_url=update_url)
load_task_id = schedule_task(default_config.scheduler, task)
instance.load_task_id = load_task_id
......
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