Skip to content

Commit

Permalink
scheduler
Browse files Browse the repository at this point in the history
  • Loading branch information
mstgnz committed Jul 7, 2024
1 parent 5ed7ba0 commit 62e55ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 29 deletions.
18 changes: 0 additions & 18 deletions schedule/alotech-call.go

This file was deleted.

12 changes: 1 addition & 11 deletions schedule/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ import (
"github.com/robfig/cron/v3"
)

// This application utilizes a database locking mechanism to prevent duplicate cronjob tasks
// when running multiple instances in a Kubernetes (k8s) environment.

// The instance that first adds a record to the schedule_logs table will be the one triggering
// the cronjob task. Subsequent instances won't be able to create a new record due to an existing one,
// resulting in an error and preventing them from executing the task.
// The microsecond differences between instances will automatically facilitate the locking mechanism.

// Nevertheless, it is strongly advised for users of this project to establish an additional control
// mechanism on their own systems.
func CallSchedule(c *cron.Cron) {
// set location
loc, err := time.LoadLocation("Europe/Istanbul")
Expand All @@ -31,7 +21,7 @@ func CallSchedule(c *cron.Cron) {
// Alotech Call - every night at 23:59
if _, err = c.AddFunc("* * * * *", func() {
config.ShuttingWrapper(func() {
AlotechCall()
// todo
})

}); err != nil {
Expand Down

0 comments on commit 62e55ba

Please sign in to comment.