Skip to content

Commit

Permalink
feat(tasks): default task id to uuid v7
Browse files Browse the repository at this point in the history
  • Loading branch information
ConsoleTVs committed Aug 4, 2024
1 parent e4fecc2 commit 7ebcf81
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
module github.com/studiolambda/yotei

go 1.22.0

require github.com/google/uuid v1.6.0 // indirect
5 changes: 5 additions & 0 deletions task.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"sync/atomic"
"time"

"github.com/google/uuid"

Check failure on line 9 in task.go

View workflow job for this annotation

GitHub Actions / Test

missing go.sum entry for module providing package github.com/google/uuid (imported by github.com/studiolambda/yotei); to add:
)

// Task is the the executionable action in the [Scheduler].
Expand Down Expand Up @@ -51,6 +53,9 @@ func NewTask(handler Handler) *Task {
task.duration.Store(int64(DurationUnlimited))
task.concurrent.Store(false)

id, _ := uuid.NewV7()
task.id.Store(id.String())

return task
}

Expand Down

0 comments on commit 7ebcf81

Please sign in to comment.