| 344 | for element := dc.order.Front(); element != nil; element = element.Next() { |
| 345 | if rehashed%startupScanChunkSize == 0 { |
| 346 | if option.summaryRehashHook != nil { |
| 347 | option.summaryRehashHook(rehashed) |
| 348 | } |
| 349 | if err := startupContext.Err(); err != nil { |
| 350 | return nil, fmt.Errorf("rebuild startup Bloom summary: %w", err) |
| 351 | } |
| 352 | } |
| 353 | dc.summary.Add(element.Value.(*cacheEntry).key) |
| 354 | rehashed++ |
| 355 | } |
| 356 | } |
| 357 | |
| 358 | if option.DurableRecency { |
| 359 | dc.recency = newRecencyWriter(dir, option.recencyQueueCapacity, option.recencyWorkerCount, option.recencyChtimes) |
| 360 | } |
| 361 | if option.convergencePermits != nil || option.BackgroundConvergence { |
| 362 | dc.startConvergence(startupContext, option.convergencePermits, option.convergenceInterval) |
| 363 | } |
| 364 | |
| 365 | slog.Info("Cache initialized.", |
| 366 | "dir", dir, |