Browse Source
Merge pull request #1977 from doccano/enhancement/retry
Add retry setting explicitly to celery tasks
pull/1982/head
Hiroki Nakayama
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
backend/data_export/celery_tasks.py
-
backend/data_import/celery_tasks.py
|
|
@ -55,7 +55,7 @@ def create_individual_dataset(project: Project, dirpath: str, confirmed_only: bo |
|
|
|
service.export(filepath) |
|
|
|
|
|
|
|
|
|
|
|
@shared_task |
|
|
|
@shared_task(autoretry_for=(Exception,), retry_backoff=True, retry_jitter=True) |
|
|
|
def export_dataset(project_id, file_format: str, confirmed_only=False): |
|
|
|
project = get_object_or_404(Project, pk=project_id) |
|
|
|
dirpath = os.path.join(settings.MEDIA_ROOT, str(uuid.uuid4())) |
|
|
|
|
|
@ -46,7 +46,7 @@ def check_uploaded_files(upload_ids: List[str], file_format: Format): |
|
|
|
return cleaned_ids, errors |
|
|
|
|
|
|
|
|
|
|
|
@shared_task |
|
|
|
@shared_task(autoretry_for=(Exception,), retry_backoff=True, retry_jitter=True) |
|
|
|
def import_dataset(user_id, project_id, file_format: str, upload_ids: List[str], task: str, **kwargs): |
|
|
|
project = get_object_or_404(Project, pk=project_id) |
|
|
|
user = get_object_or_404(get_user_model(), pk=user_id) |
|
|
|