summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal/server/continuous.go7
-rw-r--r--internal/server/scheduler.go5
-rw-r--r--internal/server/server.go6
3 files changed, 11 insertions, 7 deletions
diff --git a/internal/server/continuous.go b/internal/server/continuous.go
index 3178240..c714997 100644
--- a/internal/server/continuous.go
+++ b/internal/server/continuous.go
@@ -28,12 +28,13 @@ func (c *continuous) start(ctx context.Context) {
}
func (c *continuous) runJobs(ctx context.Context) {
- for _, job := range c.cfg.Server.Continuous {
+ for i := range c.cfg.Server.Continuous {
+ job := &c.cfg.Server.Continuous[i]
if !job.Enable {
dlog.Server.Debug(job.Name, "Not running job as not enabled")
continue
}
- go func(job config.Continuous) {
+ go func(job *config.Continuous) {
c.runJob(ctx, job)
retryTicker := time.NewTicker(time.Minute)
defer retryTicker.Stop()
@@ -50,7 +51,7 @@ func (c *continuous) runJobs(ctx context.Context) {
}
}
-func (c *continuous) runJob(ctx context.Context, job config.Continuous) {
+func (c *continuous) runJob(ctx context.Context, job *config.Continuous) {
dlog.Server.Debug(job.Name, "Processing job")
files := fillDates(job.Files)
diff --git a/internal/server/scheduler.go b/internal/server/scheduler.go
index abfe257..fa47d2e 100644
--- a/internal/server/scheduler.go
+++ b/internal/server/scheduler.go
@@ -42,7 +42,8 @@ func (s *scheduler) start(ctx context.Context) {
}
func (s *scheduler) runJobs(ctx context.Context) {
- for _, job := range s.cfg.Server.Schedule {
+ for i := range s.cfg.Server.Schedule {
+ job := &s.cfg.Server.Schedule[i]
if !job.Enable {
dlog.Server.Debug(job.Name, "Not running job as not enabled")
continue
@@ -60,7 +61,7 @@ func (s *scheduler) runJobs(ctx context.Context) {
}
}
-func (s *scheduler) runJob(ctx context.Context, job config.Scheduled) {
+func (s *scheduler) runJob(ctx context.Context, job *config.Scheduled) {
files := fillDates(job.Files)
outfile := fillDates(job.Outfile)
diff --git a/internal/server/server.go b/internal/server/server.go
index edb1953..1dd0121 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -309,7 +309,8 @@ func (s *Server) authorizeHealthUser(user *user.User, authInfo, _ string) bool {
}
func (s *Server) authorizeScheduleUser(user *user.User, authInfo, remoteIP string) bool {
- for _, job := range s.cfg.Server.Schedule {
+ for i := range s.cfg.Server.Schedule {
+ job := &s.cfg.Server.Schedule[i]
if s.backgroundCanSSH(user, authInfo, remoteIP, job.Name, job.AllowFrom) {
dlog.Server.Debug(user, "Granting SSH connection")
return true
@@ -319,7 +320,8 @@ func (s *Server) authorizeScheduleUser(user *user.User, authInfo, remoteIP strin
}
func (s *Server) authorizeContinuousUser(user *user.User, authInfo, remoteIP string) bool {
- for _, job := range s.cfg.Server.Continuous {
+ for i := range s.cfg.Server.Continuous {
+ job := &s.cfg.Server.Continuous[i]
if s.backgroundCanSSH(user, authInfo, remoteIP, job.Name, job.AllowFrom) {
dlog.Server.Debug(user, "Granting SSH connection")
return true