Skip to content

Commit

Permalink
fix: removed channel causing windows not to sync (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jia Wei Lee authored Aug 5, 2022
1 parent 7ab3180 commit 294b0ce
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions internal/cron/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 {
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 294b0ce

Please sign in to comment.