From 294b0cea8c31966b0e8c3cfec39348c0ec2b4d96 Mon Sep 17 00:00:00 2001 From: Jia Wei Lee Date: Fri, 5 Aug 2022 20:23:12 +0800 Subject: [PATCH] fix: removed channel causing windows not to sync (#59) --- internal/cron/cron.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/internal/cron/cron.go b/internal/cron/cron.go index 390db32..a9ef76e 100644 --- a/internal/cron/cron.go +++ b/internal/cron/cron.go @@ -7,7 +7,6 @@ import ( "strings" "time" - appApp "github.com/beebeeoii/lominus/internal/app" appAuth "github.com/beebeeoii/lominus/internal/app/auth" appDir "github.com/beebeeoii/lominus/internal/app/dir" intTelegram "github.com/beebeeoii/lominus/internal/app/integrations/telegram" @@ -27,13 +26,11 @@ import ( var mainScheduler *gocron.Scheduler var mainJob *gocron.Job -var LastRanChannel chan string // Init initialises the cronjob with the desired frequency set by the user. // If frequency is unset, cronjob is not initialised. func Init() error { mainScheduler = gocron.NewScheduler(time.Local) - LastRanChannel = make(chan string) preferencesPath, getPreferencesPathErr := appPref.GetPreferencesPath() if getPreferencesPathErr != nil { @@ -98,9 +95,6 @@ func GetLastRan() time.Time { func createJob(frequency int) (*gocron.Job, error) { return mainScheduler.Every(frequency).Hours().Do(func() { logs.Logger.Infof("job started: %s", time.Now().Format(time.RFC3339)) - if appApp.GetOs() == "windows" { - LastRanChannel <- GetLastRan().Format("2 Jan 15:04:05") - } logs.Logger.Debugln("retrieving - preferences path") preferencesPath, getPreferencesPathErr := appPref.GetPreferencesPath()