]> git.lizzy.rs Git - go-anidb.git/blob - misc.go
anime: Make cached Anime expire earlier if they're Incomplete
[go-anidb.git] / misc.go
1 package anidb
2
3 import (
4         "time"
5 )
6
7 type Language string
8
9 var (
10         // Default durations for the various caches.
11         // Used by the IsStale methods.
12         DefaultCacheDuration = 7 * 24 * time.Hour
13         AnimeCacheDuration   = DefaultCacheDuration
14         EpisodeCacheDuration = DefaultCacheDuration
15         GroupCacheDuration   = 4 * DefaultCacheDuration // They don't change that often.
16         FileCacheDuration    = 8 * DefaultCacheDuration // These change even less often.
17
18         // Used when the UDP API Anime query fails, but the HTTP API query succeeds.
19         AnimeIncompleteCacheDuration = 24 * time.Hour
20
21         // Used when there's some data missing on a file.
22         // Usually happens because the AVDump data hasn't been merged with the database
23         // yet, which is done on a daily cron job.
24         FileIncompleteCacheDuration = 24 * time.Hour
25 )