Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions osf_tests/test_archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,6 @@ def test_archive_addon_does_not_trigger_callback_immediately(self, mock_archive_

mock_archive_callback.assert_not_called()

@mock.patch('website.archiver.tasks.handlers.enqueue_task')
@mock.patch('website.archiver.tasks.archive_callback.si')
@mock.patch('website.archiver.tasks.make_copy_request.s')
@mock.patch('website.archiver.tasks.celery.chain')
Expand All @@ -630,7 +629,6 @@ def test_archive_node_only_enqueues_addon_work_before_callback(
mock_chain,
mock_make_copy_request_s,
mock_archive_callback,
mock_enqueue_task,
):
settings.MAX_ARCHIVE_SIZE = 1024 ** 3
with mock.patch.object(BaseStorageAddon, '_get_file_tree') as mock_file_tree:
Expand All @@ -653,7 +651,6 @@ def test_archive_node_only_enqueues_addon_work_before_callback(
mock_group.return_value,
mock_archive_callback.return_value,
])
mock_enqueue_task.assert_called_once_with(mock_chain.return_value)

@pytest.mark.usefixtures('mock_gravy_valet_get_verified_links')
def test_archive_success(self):
Expand Down
21 changes: 10 additions & 11 deletions website/archiver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import celery
from celery.utils.log import get_task_logger

from framework.celery_tasks import app as celery_app, handlers
from framework.celery_tasks import app as celery_app
from framework.celery_tasks.utils import logged
from framework.exceptions import HTTPError
from framework import sentry
Expand Down Expand Up @@ -395,16 +395,15 @@ def archive_node(self, stat_results, job_pk):
)

if not addon_tasks:
handlers.enqueue_task(archive_callback.si(dst_id=dst._id))
return

handlers.enqueue_task(
celery.chain(
[
celery.group(addon_tasks),
archive_callback.si(dst_id=dst._id),
]
)
return celery.chain([
archive_callback.si(dst_id=dst._id)
])

return celery.chain(
[
celery.group(addon_tasks),
archive_callback.si(dst_id=dst._id),
]
)


Expand Down