mirror of
https://github.com/vmware-tanzu/velero.git
synced 2026-01-08 06:15:40 +00:00
Empty the list before next round of listing
Empty the list before next round of listing Signed-off-by: Wenkai Yin(尹文开) <yinw@vmware.com>
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