Now all indicator updates properly

This commit is contained in:
eleksir
2024-09-23 19:05:45 +03:00
parent 1a4ab136dc
commit 5bb259a30c
15 changed files with 228 additions and 231 deletions

View File

@@ -10,7 +10,7 @@ import (
var myCron gocron.Scheduler
// RunCron parses config part, related to cron tasks and kicks cron to run.
func RunCron() {
func (c MyConfig) RunCron() {
var err error
myCron, err = gocron.NewScheduler()
@@ -21,14 +21,14 @@ func RunCron() {
return
}
for _, job := range Conf.Cron.Tasks {
for _, job := range c.Cron.Tasks {
_, err := myCron.NewJob(
gocron.CronJob(job.Time, false),
gocron.NewTask(
// Сука, просто заспавнить бинарь, ну почему это надо делать через жопу-то?
any(
func() bool {
RunChan <- job.Cmd
c.Channels.RunChan <- job.Cmd
return true
},