mirror of
https://github.com/lukaszraczylo/gohoarder.git
synced 2026-11-27 06:46:01 +00:00
feat(cache): rescan stale cache hits before serving
With security.rescan_on_access and rescan_interval set, a hit whose scan result is missing or older than the interval is rescanned before it is served. Concurrent hits share one scan, and the scan runs under the manager context so a client disconnect does not abort it. The wait is bounded by scan_wait_timeout. On a timeout the previous result decides, or the first-download rule applies when none exists.
This commit is contained in:
@@ -187,6 +187,7 @@ type SecurityConfig struct {
|
||||
FailClosed bool `mapstructure:"fail_closed" json:"fail_closed"` // refuse packages whose scan failed on infrastructure
|
||||
Enabled bool `mapstructure:"enabled" json:"enabled"`
|
||||
ScanOnDownload bool `mapstructure:"scan_on_download" json:"scan_on_download"`
|
||||
RescanOnAccess bool `mapstructure:"rescan_on_access" json:"rescan_on_access"` // rescan a stale cache hit before serving it; needs rescan_interval
|
||||
UpdateDBOnStartup bool `mapstructure:"update_db_on_startup" json:"update_db_on_startup"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user