]> git.lizzy.rs Git - go-anidb.git/blob - globals.go
Modernize
[go-anidb.git] / globals.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         MyListCacheDuration        = 12 * time.Hour           // When the file isn't watched
19         MyListWatchedCacheDuration = 2 * DefaultCacheDuration // When the file is watched
20
21         LIDCacheDuration = 4 * DefaultCacheDuration
22
23         UIDCacheDuration = 16 * DefaultCacheDuration // Can these even be changed?
24
25         // Used for anime that have already finished airing.
26         // It's unlikely that they get any important updates.
27         FinishedAnimeCacheDuration = 4 * AnimeCacheDuration
28
29         // Used when a request uses a non-existing key (AID, ed2k+size, etc)
30         InvalidKeyCacheDuration = 1 * time.Hour
31
32         // Used when the UDP API Anime query fails, but the HTTP API query succeeds.
33         AnimeIncompleteCacheDuration = 24 * time.Hour
34
35         // Used when there's some data missing on a file.
36         // Usually happens because the AVDump data hasn't been merged with the database
37         // yet, which is done on a daily cron job.
38         FileIncompleteCacheDuration = 24 * time.Hour
39 )