Skip to content

Commit

Permalink
use uuid for job id (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagonalez authored Jan 12, 2022
1 parent ea1c119 commit 261b0d6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion cron/queue_job.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/contribsys/faktory/client"
"github.com/contribsys/faktory/util"
"github.com/google/uuid"
"github.com/robfig/cron/v3"
)

Expand All @@ -25,7 +26,7 @@ func (c *QueueJob) Run() {
return
}
// assign new job id
job.Jid = client.RandomJid()
job.Jid = uuid.NewString()
job.CreatedAt = util.Nows()
// job has already been validated as a proper job on startup
if err := c.Subsystem.Server.Manager().Push(&job); err != nil {
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ require github.com/contribsys/faktory v1.5.5
require (
github.com/DataDog/datadog-go v4.8.2+incompatible
github.com/golang/mock v1.6.0
github.com/google/uuid v1.3.0
github.com/robfig/cron/v3 v3.0.0
github.com/stretchr/testify v1.7.0
)

Expand All @@ -18,7 +20,6 @@ require (
github.com/justinas/nosurf v1.1.1 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/robfig/cron/v3 v3.0.0 // indirect
golang.org/x/net v0.0.0-20211013171255-e13a2654a71e // indirect
golang.org/x/sys v0.0.0-20211013075003-97ac67df715c // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
github.com/justinas/nosurf v1.1.1 h1:92Aw44hjSK4MxJeMSyDa7jwuI9GR2J/JCQiaKvXXSlk=
github.com/justinas/nosurf v1.1.1/go.mod h1:ALpWdSbuNGy2lZWtyXdjkYv4edL23oSEgfBT1gPJ5BQ=
Expand Down

0 comments on commit 261b0d6

Please sign in to comment.