FlagUpdateHashFileInterval added

This commit is contained in:
Tordarus 2025-01-15 15:22:22 +01:00
parent 55a7cdc36f
commit 45f5c9d06a
2 changed files with 5 additions and 4 deletions

View File

@ -29,7 +29,7 @@ func InitCache() {
}
go func() {
ticker := time.NewTicker(10 * time.Second)
ticker := time.NewTicker(FlagUpdateHashFileInterval)
defer ticker.Stop()
for range ticker.C {
if err := WriteCache(); err != nil {

View File

@ -17,9 +17,10 @@ import (
)
var ( // flags
FlagSourceDir = envvars.String("SOURCE_PATH", "/video")
FlagTargetDir = envvars.String("TARGET_PATH", "/audio")
FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin")
FlagSourceDir = envvars.String("SOURCE_PATH", "/video")
FlagTargetDir = envvars.String("TARGET_PATH", "/audio")
FlagCacheFile = envvars.String("CACHE_FILE", "/hashes.bin")
FlagUpdateHashFileInterval = envvars.Duration("UPDATE_CACHE_FILE_INTERVAL", 10*time.Second)
)
func main() {