Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix trigger check lock in handleTriggerInLock #992

Merged
merged 4 commits into from
Feb 15, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion checker/worker/trigger_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ func (manager *WorkerManager) handleTrigger(triggerID string, metrics *metrics.C

func (manager *WorkerManager) handleTriggerInLock(triggerID string, metrics *metrics.CheckMetrics) error {
acquired, err := manager.Database.SetTriggerCheckLock(triggerID)
defer manager.Database.DeleteTriggerCheckLock(triggerID) //nolint

if err != nil {
return err
Expand All @@ -57,6 +56,8 @@ func (manager *WorkerManager) handleTriggerInLock(triggerID string, metrics *met
return nil
}

defer manager.Database.DeleteTriggerCheckLock(triggerID) //nolint

startedAt := time.Now()
defer metrics.TriggersCheckTime.UpdateSince(startedAt)

Expand Down
Loading