feat(notifications): added notifications business logic
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import logging
|
||||
|
||||
from apps.notifications.services import flush_pending_notifications
|
||||
from config.celery import app
|
||||
|
||||
logger = logging.getLogger("lotty")
|
||||
|
||||
|
||||
@app.task(bind=True, name="notifications.flush_pending")
|
||||
def flush_pending_notifications_task(self):
|
||||
results = flush_pending_notifications()
|
||||
logger.info(
|
||||
"notifications_flush_completed",
|
||||
extra={
|
||||
"sent": results["sent"],
|
||||
"failed": results["failed"],
|
||||
},
|
||||
)
|
||||
return results
|
||||
Reference in New Issue
Block a user