-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
93c54f4
commit 80d07eb
Showing
4 changed files
with
91 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# app/tasks/send_to_all.py | ||
|
||
from app.celery_app import celery | ||
from app.tasks.upload_to_dropbox import upload_to_dropbox | ||
from app.tasks.upload_to_nextcloud import upload_to_nextcloud | ||
from app.tasks.upload_to_paperless import upload_to_paperless | ||
|
||
@celery.task | ||
def send_to_all_destinations(file_path: str): | ||
""" | ||
Fires off tasks to upload a single file to Dropbox, Nextcloud, and Paperless. | ||
These tasks run in parallel (Celery returns immediately from each .delay()). | ||
""" | ||
upload_to_dropbox.delay(file_path) | ||
upload_to_nextcloud.delay(file_path) | ||
upload_to_paperless.delay(file_path) | ||
|
||
return { | ||
"status": "All upload tasks enqueued", | ||
"file_path": file_path | ||
} |