Update Notification Handler to Send Notifications Asynchronously

- Modified the Send method in the NotificationHandler to dispatch notifications asynchronously by using a goroutine, improving responsiveness and allowing the handler to return immediately after initiating the send process.
- This change enhances the user experience by not blocking the request while the notification is being sent, ensuring smoother operation of the API.
This commit is contained in:
n.nakhostin
2025-10-20 11:57:37 +03:30
parent 7b09291271
commit 889a56a9f9
+1 -1
View File
@@ -50,7 +50,7 @@ func (h *NotificationHandler) Send(c echo.Context) error {
} }
// Send notification // Send notification
h.service.Send(context.Background(), &req) go h.service.Send(context.Background(), &req)
return response.Created(c, nil, "Notification sent successfully") return response.Created(c, nil, "Notification sent successfully")
} }