added CET timezone

This commit is contained in:
Mukhtar Akere
2025-06-16 22:41:46 +01:00
parent 605d5b81c2
commit b7226b21ec

View File

@@ -108,7 +108,14 @@ type Cache struct {
func NewDebridCache(dc config.Debrid, client types.Client) *Cache { func NewDebridCache(dc config.Debrid, client types.Client) *Cache {
cfg := config.Get() cfg := config.Get()
cetSc, err := gocron.NewScheduler(gocron.WithLocation(time.UTC)) cet, err := time.LoadLocation("CET")
if err != nil {
cet, err = time.LoadLocation("Europe/Berlin") // Fallback to Berlin if CET fails
if err != nil {
cet = time.FixedZone("CET", 1*60*60) // Fallback to a fixed CET zone
}
}
cetSc, err := gocron.NewScheduler(gocron.WithLocation(cet))
if err != nil { if err != nil {
// If we can't create a CET scheduler, fallback to local time // If we can't create a CET scheduler, fallback to local time
cetSc, _ = gocron.NewScheduler(gocron.WithLocation(time.Local)) cetSc, _ = gocron.NewScheduler(gocron.WithLocation(time.Local))