Skip to content

Commit

Permalink
fix: need to start cleanup thread before InitHTTP
Browse files Browse the repository at this point in the history
InitHTTP doesn't exit until shutdown
  • Loading branch information
msvticket committed Mar 6, 2024
1 parent 8015896 commit 67a2406
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ cache:
The clean interval of 24 hours is the default, while the cache time doesn't have a default. This means
that cleaning of the cache isn't enabled by default.
If you do want cloud storage to be cleaned you can for example in the case of s3 ad a lifecycle policy to
[!NOTE] For this to work the access times needs to be recorded in the file system used for caching. Typically it is.
If you do want cloud storage to be cleaned you can for example in the case of s3 add a lifecycle policy to
the bucket.
### Supported Artifacts
Expand Down
6 changes: 3 additions & 3 deletions internal/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ func main() {
logrus.Fatalf("failed to initialise controller: %s", err.Error())
}

logrus.Infof("serving http")
InitHTTP(config.HTTP, controller)

if config.Cache.CacheTime != 0 {
ticker := time.NewTicker(config.Cache.CleanInterval)
go func(ticker *time.Ticker) {
Expand All @@ -55,4 +52,7 @@ func main() {
}
}(ticker)
}

logrus.Infof("serving http")
InitHTTP(config.HTTP, controller)
}

0 comments on commit 67a2406

Please sign in to comment.