Skip to content

Commit

Permalink
fix reenqueue logic
Browse files Browse the repository at this point in the history
  • Loading branch information
limhawjia committed Jul 18, 2023
1 parent 57af0f9 commit 14578c1
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions pkg/util/informermanager/informermanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,7 @@ func (m *informerManager) worker(ctx context.Context) {
if err != nil {
if needReenqueue {
logger.Error(err, "Failed to process FederatedTypeConfig, will retry")
if delay > 0 {
m.queue.AddAfter(key, delay)
} else {
m.queue.AddRateLimited(key)
}
m.queue.AddRateLimited(key)
} else {
logger.Error(err, "Failed to process FederatedTypeConfig")
m.queue.Forget(key)
Expand All @@ -153,18 +149,14 @@ func (m *informerManager) worker(ctx context.Context) {

m.queue.Forget(key)
if needReenqueue {
if delay > 0 {
m.queue.AddAfter(key, delay)
} else {
m.queue.AddRateLimited(key)
}
m.queue.AddAfter(key, delay)
}
}

func (m *informerManager) processFTC(
ctx context.Context,
ftc *fedcorev1a1.FederatedTypeConfig,
) (err error, needReenqueue bool, delay time.Duration) {
) (err error, needReenqueue bool, reenqueueDelay time.Duration) {

Check failure on line 159 in pkg/util/informermanager/informermanager.go

View workflow job for this annotation

GitHub Actions / lint

ST1008: error should be returned as the last argument (stylecheck)
m.lock.Lock()
defer m.lock.Unlock()

Expand Down

0 comments on commit 14578c1

Please sign in to comment.