Skip to content

Commit

Permalink
Non-Blocking write to wakeup channel (#6007)
Browse files Browse the repository at this point in the history
  • Loading branch information
itaiad200 authored Jun 1, 2023
1 parent c47aade commit 1e12dca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/graveler/staging/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,11 @@ func (m *Manager) Drop(ctx context.Context, st graveler.StagingToken) error {

func (m *Manager) DropAsync(ctx context.Context, st graveler.StagingToken) error {
err := m.kvStore.Set(ctx, []byte(graveler.CleanupTokensPartition()), []byte(st), []byte("stub-value"))
m.wakeup <- cleanTokens
select {
case m.wakeup <- cleanTokens:
default:
m.log.Debug("wakeup channel is full, skipping wakeup")
}
return err
}

Expand Down

0 comments on commit 1e12dca

Please sign in to comment.