-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Delay report handlers to Celery task
- Loading branch information
Showing
5 changed files
with
62 additions
and
37 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 @@ | ||
from celery import shared_task | ||
|
||
from .site import report_event_handlers | ||
|
||
|
||
@shared_task | ||
def report_created(document_id: str) -> None: | ||
for handler in report_event_handlers: | ||
handler("created", document_id) | ||
|
||
|
||
@shared_task | ||
def report_updated(document_id: str) -> None: | ||
for handler in report_event_handlers: | ||
handler("updated", document_id) | ||
|
||
|
||
@shared_task | ||
def report_deleted(document_id: str) -> None: | ||
for handler in report_event_handlers: | ||
handler("deleted", document_id) |
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