From f9f8eba78683a0db441a92a42fb40dd155c28035 Mon Sep 17 00:00:00 2001 From: alvin-reyes Date: Wed, 15 Mar 2023 11:18:53 -0400 Subject: [PATCH] decrease pinmgr threads and add last cont id --- cmd/estuary-shuttle/main.go | 2 +- deal/worker.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/estuary-shuttle/main.go b/cmd/estuary-shuttle/main.go index c8e8aab9..042f7e38 100644 --- a/cmd/estuary-shuttle/main.go +++ b/cmd/estuary-shuttle/main.go @@ -557,7 +557,7 @@ func main() { MaxActivePerUser: 30, QueueDataDir: cfg.DataDir, }, log) - go s.PinMgr.Run(300) + go s.PinMgr.Run(10) // only refresh pin queue if pin queue refresh and local adding are enabled if !cfg.NoReloadPinQueue && !cfg.Content.DisableLocalAdding { diff --git a/deal/worker.go b/deal/worker.go index c8367855..22280372 100644 --- a/deal/worker.go +++ b/deal/worker.go @@ -55,7 +55,7 @@ func (m *manager) runDealBackFillWorker(ctx context.Context) { m.log.Debugf("trying to start deal queue backfill, starting from content: %d", tracker.LastContID) var contents []*util.Content - if err := m.db.Where("size >= ? and size <= ? and active", m.cfg.Content.MinSize, m.cfg.Content.MaxSize).Order("id asc").Limit(2000).Find(&contents).Error; err != nil { + if err := m.db.Where("size >= ? and size <= ? and active and id > ?", m.cfg.Content.MinSize, m.cfg.Content.MaxSize, tracker.LastContID).Order("id asc").Limit(2000).Find(&contents).Error; err != nil { m.log.Warnf("failed to get contents for deal queue backfill - %s", err) continue }