Queue cancellation mechanism: - Add CancelByAlertIDs method to mark queued notifications as cancelled when alerts resolve - Update CancelAlert to cancel queued notifications containing resolved alert IDs - Skip cancelled notifications in queue processor - Prevents resolved alerts from triggering notifications after they clear Atomic DB operations: - Add IncrementAttemptAndSetStatus to atomically update attempt counter and status - Replace separate IncrementAttempt + UpdateStatus calls with single atomic operation - Prevents orphaned queue entries when crashes occur between operations - Eliminates race condition where rows get stuck in "pending" or "sending" status These fixes ensure queued notifications are properly cancelled when alerts resolve and prevent database inconsistencies during crash scenarios. |
||
|---|---|---|
| .. | ||
| concurrency_test.go | ||
| email_enhanced.go | ||
| email_providers.go | ||
| email_template.go | ||
| notifications.go | ||
| notifications_test.go | ||
| queue.go | ||
| webhook_enhanced.go | ||
| webhook_templates.go | ||