mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 21:17:58 +08:00
fix: GetNextRepository to use a list already scanned repositories as input (#3230)
Using just the last repository is not enough as in the case when it is deleted (either by GC or some other way), GetNextRepository returns empty string causing the generator to be marked completed without any errors. An alternative would have been to start over from the first repository, but this can take hours if multiple repositories need to be deleted, not to mention the processing power and I/O and S3 load this could take. Signed-off-by: Andrei Aaron <aaaron@luxoft.com>
This commit is contained in:
@@ -467,12 +467,13 @@ func TestPopulateStorageMetrics(t *testing.T) {
|
||||
sch := scheduler.NewScheduler(conf, metrics, ctlr.Log)
|
||||
sch.RunScheduler()
|
||||
|
||||
generator := &common.StorageMetricsInitGenerator{
|
||||
ImgStore: ctlr.StoreController.DefaultStore,
|
||||
Metrics: ctlr.Metrics,
|
||||
Log: ctlr.Log,
|
||||
MaxDelay: 1, // maximum delay between jobs (each job computes repo's storage size)
|
||||
}
|
||||
generator := common.NewStorageMetricsInitGenerator(
|
||||
ctlr.StoreController.DefaultStore,
|
||||
ctlr.Metrics,
|
||||
ctlr.Log,
|
||||
)
|
||||
|
||||
generator.MaxDelay = 1 // maximum delay between jobs (each job computes repo's storage size)
|
||||
|
||||
sch.SubmitGenerator(generator, time.Duration(0), scheduler.LowPriority)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user