add file system persistence of record API calls to avoid hammering the discogs API
This commit is contained in:
@@ -129,16 +129,10 @@ func main() {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
log.Printf("latest migration: %d; migrations run: %d", latest, run)
|
||||
discogsCache, err := database.NewDiscogsCache(c.DiscogsToken, time.Hour*24, "delta.mu.alpha")
|
||||
discogsCache, err := database.NewDiscogsCache(c.DiscogsToken, time.Hour*24, c.DiscogsUser, c.DiscogsPersist, c.DiscogsCacheFile)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
go func() {
|
||||
err := discogsCache.FlushCache(context.Background())
|
||||
if err != nil {
|
||||
log.Printf("error loading discogs content: %v", err)
|
||||
}
|
||||
}()
|
||||
r := &Router{
|
||||
static: f,
|
||||
lib: lib,
|
||||
|
Reference in New Issue
Block a user