Skip to content

Fix/idempotency cleanup scheduler - #181

Open
GiftedGiftB wants to merge 3 commits into
parkerwinner:mainfrom
GiftedGiftB:fix/idempotency-cleanup-scheduler
Open

Fix/idempotency cleanup scheduler#181
GiftedGiftB wants to merge 3 commits into
parkerwinner:mainfrom
GiftedGiftB:fix/idempotency-cleanup-scheduler

Conversation

@GiftedGiftB

Copy link
Copy Markdown

close #179

Description

This PR addresses the issue where expired idempotency records were accumulating in the database by properly invoking and managing the StartIdempotencyCleanupScheduler.

Changes Made:

  • Scheduler Activation: Integrated the StartIdempotencyCleanupScheduler call in backend/main.go using a 1-hour interval.
  • Graceful Shutdown: Added context.Context and *sync.WaitGroup arguments to the scheduler. It now appropriately stops the ticker and completes the goroutine during the application's shutdown sequence.
  • Logging Statistics: The scheduler now logs the exact number of expired idempotency records it clears every tick (Cleaned up expired idempotency records).
  • Fix: Resolved an invalid type assertion panic (c.Writer.(*gin.ResponseWriter)) within idempotency.go.

Acceptance Criteria Met

  • Call StartIdempotencyCleanupScheduler in main.go
  • Set cleanup interval to 1 hour
  • Add graceful shutdown for cleanup goroutine
  • Log cleanup statistics

Testing

  • Verified compilation success using go build main.go.
  • Application boot sequence accurately initializes the scheduler alongside background workers.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@GiftedGiftB Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@parkerwinner

Copy link
Copy Markdown
Owner

fix conflict @GiftedGiftB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing Idempotency Cleanup Job

2 participants