Skip to content

Commit

Permalink
Upgrade BurntSushi/toml to avoid decoding bug (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
lackstein committed Oct 31, 2022
1 parent 2aace37 commit 87d22d1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion cron/cron.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package cron
import (
"encoding/json"
"fmt"

"github.com/DataDog/datadog-go/statsd"
"github.com/contribsys/faktory/client"
"github.com/contribsys/faktory/server"
Expand Down Expand Up @@ -106,7 +107,7 @@ func (c *CronSubsystem) createCron() {
}

func (c *CronSubsystem) addCronJobs() error {
for index, _ := range c.Options.CronJobs {
for index := range c.Options.CronJobs {
job := &c.Options.CronJobs[index]
id, err := c.Cron.AddJob(job.Schedule, &QueueJob{
Subsystem: c,
Expand Down
11 changes: 9 additions & 2 deletions cron/cron_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const (
args = [1, 3]
[cron.job.custom]
testing = true
[[ cron ]]
schedule = "* * * * * *" # every second
[cron.job]
Expand Down Expand Up @@ -298,7 +298,14 @@ func TestCron(t *testing.T) {
func runSystem(configDir string, runner func(s *server.Server)) {
dir := "/tmp/cron_system.db"
defer os.RemoveAll(dir)
opts := &cli.CliOptions{"localhost:7417", "localhost:7420", "development", configDir, "debug", dir}
opts := &cli.CliOptions{
CmdBinding: "localhost:7417",
WebBinding: "localhost:7420",
Environment: "development",
ConfigDirectory: configDir,
LogLevel: "debug",
StorageDirectory: dir,
}
s, stopper, err := cli.BuildServer(opts)

defer s.Stop(nil)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
)

require (
github.com/BurntSushi/toml v0.4.1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/Microsoft/go-winio v0.5.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/justinas/nosurf v1.1.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
github.com/BurntSushi/toml v0.4.1 h1:GaI7EiDXDRfa8VshkTj7Fym7ha+y8/XxIgD2okUIjLw=
github.com/BurntSushi/toml v0.4.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/BurntSushi/toml v1.2.1 h1:9F2/+DoOYIOksmaJFPw1tGFy1eDnIJXg+UHjuD8lTak=
github.com/BurntSushi/toml v1.2.1/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
github.com/DataDog/datadog-go v4.8.2+incompatible h1:qbcKSx29aBLD+5QLvlQZlGmRMF/FfGqFLFev/1TDzRo=
github.com/DataDog/datadog-go v4.8.2+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/Microsoft/go-winio v0.5.1 h1:aPJp2QD7OOrhO5tQXqQoGSJc+DjDtWTGLOmNyAm6FgY=
Expand Down

0 comments on commit 87d22d1

Please sign in to comment.