fix: [Cherry-pick] Use correct ticker for gc work defer (#31456) (#31462)

Cherry-pick from master
pr: #31456
See also #31362

Fix the second defer using same ticker var.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/31471/head
congqixia 2024-03-21 14:29:07 +08:00 committed by GitHub
parent a0535edb67
commit df154ccfc7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ func (gc *garbageCollector) work() {
ticker := time.NewTicker(gc.option.checkInterval)
defer ticker.Stop()
scanTicker := time.NewTicker(gc.option.scanInterval)
defer ticker.Stop()
defer scanTicker.Stop()
for {
select {
case <-ticker.C: