Skip to content

Commit

Permalink
Remove unnecessary atomic decorators from tasks
Browse files Browse the repository at this point in the history
The `atomic` decorator isn't actually needed on these task functions.
Any parts of the tasks that need to be atomic are already marked as
such inside the functions that the tasks call.
  • Loading branch information
mvandenburgh committed Oct 18, 2023
1 parent 7b3cbd4 commit 67799cf
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions dandiapi/api/tasks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from celery import shared_task
from celery.utils.log import get_task_logger
from django.db.transaction import atomic

from dandiapi.api.doi import delete_doi
from dandiapi.api.manifests import (
Expand Down Expand Up @@ -33,7 +32,6 @@ def calculate_sha256(blob_id: str) -> None:


@shared_task(soft_time_limit=180)
@atomic
def write_manifest_files(version_id: int) -> None:
version: Version = Version.objects.get(id=version_id)
logger.info('Writing manifests for version %s:%s', version.dandiset.identifier, version.version)
Expand All @@ -46,7 +44,6 @@ def write_manifest_files(version_id: int) -> None:


@shared_task(soft_time_limit=10)
@atomic
def validate_asset_metadata_task(asset_id: int) -> None:
from dandiapi.api.services.metadata import validate_asset_metadata

Expand All @@ -56,7 +53,6 @@ def validate_asset_metadata_task(asset_id: int) -> None:


@shared_task(soft_time_limit=30)
@atomic
def validate_version_metadata_task(version_id: int) -> None:
from dandiapi.api.services.metadata import validate_version_metadata

Expand All @@ -78,7 +74,6 @@ def unembargo_dandiset_task(dandiset_id: int):


@shared_task
@atomic
def publish_dandiset_task(dandiset_id: int):
from dandiapi.api.services.publish import _publish_dandiset

Expand Down

0 comments on commit 67799cf

Please sign in to comment.