Skip to content

Commit

Permalink
fix: speedup event sync upon error (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker authored Jun 27, 2023
1 parent dfe386a commit 79b9ecc
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 71 deletions.
16 changes: 16 additions & 0 deletions pkg/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,19 @@ func setupSignalHandler() (stopCh <-chan struct{}) {

return stop
}

// Result contains the result of a sync invocation.
type Result struct {
// Requeue tells the Controller to requeue the reconcile key. Defaults to false.
Requeue bool

// RequeueAfter if greater than 0, tells the Controller to requeue the reconcile key after the Duration.
// Implies that Requeue is true, there is no need to set Requeue to true at the same time as RequeueAfter.
RequeueAfter time.Duration
}

// WrapResult is wrap for result.
// We can find where return result.
func WrapResult(result Result, err error) (Result, error) {
return result, err
}
Loading

0 comments on commit 79b9ecc

Please sign in to comment.