mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-09-20 06:54:32 +00:00
Merge pull request #7634 from ywk253100/240408_periodical_queue
Empty the list before next round of listing
This commit is contained in:
@@ -69,6 +69,11 @@ type PeriodicalEnqueueSourceOption struct {
|
||||
func (p *PeriodicalEnqueueSource) Start(ctx context.Context, h handler.EventHandler, q workqueue.RateLimitingInterface, predicates ...predicate.Predicate) error {
|
||||
go wait.Until(func() {
|
||||
p.logger.Debug("enqueueing resources ...")
|
||||
// empty the list otherwise the result of the new list call will be appended
|
||||
if err := meta.SetList(p.objList, nil); err != nil {
|
||||
p.logger.WithError(err).Error("error reset resource list")
|
||||
return
|
||||
}
|
||||
if err := p.List(ctx, p.objList); err != nil {
|
||||
p.logger.WithError(err).Error("error listing resources")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user