Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade BurntSushi/toml to avoid decoding bug #26

Merged
merged 4 commits into from
Oct 31, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ require (
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/BurntSushi/toml v0.4.1 => github.com/BurntSushi/toml v1.2.1
lackstein marked this conversation as resolved.
Show resolved Hide resolved
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