Skip to content

Commit

Permalink
fix: remove run_id
Browse files Browse the repository at this point in the history
  • Loading branch information
WangYihang committed Jul 2, 2024
1 parent 8df6152 commit f10ebcd
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/jessevdk/go-flags v1.5.0
github.com/prometheus/client_golang v1.19.0
github.com/prometheus/client_model v0.6.1
github.com/rabbitmq/amqp091-go v1.10.0
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ github.com/prometheus/common v0.48.0 h1:QO8U2CdOzSn1BBsmXJXduaaW+dY/5QLjfB8svtSz
github.com/prometheus/common v0.48.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/rabbitmq/amqp091-go v1.10.0 h1:STpn5XsHlHGcecLmMFCtg7mqq0RnD+zFr4uzukfVhBw=
github.com/rabbitmq/amqp091-go v1.10.0/go.mod h1:Hy4jKW5kQART1u+JkDTF9YYOQUHXqMuhrgxOEeS7G4o=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down
4 changes: 4 additions & 0 deletions pkg/utils/io.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ func (wc ReadDiscardCloser) Close() error {
}

func OpenFile(path string) (io.WriteCloser, error) {
return OpenLocalFile(path)
}

func OpenLocalFile(path string) (io.WriteCloser, error) {
switch path {
case "-":
return ReadDiscardCloser{Writer: os.Stdout, Reader: os.Stdin}, nil
Expand Down
2 changes: 1 addition & 1 deletion scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (s *Scheduler) Submit(task Task) {
index := s.currentIndex.Load()
if (index % s.numShards) == s.shard {
s.taskWg.Add(1)
s.taskChan <- newBasicTask(index, s.id, task)
s.taskChan <- newBasicTask(index, task)
}
s.currentIndex.Add(1)
}
Expand Down
4 changes: 1 addition & 3 deletions task.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ type Task interface {

type basicTask struct {
Index int64 `json:"index"`
RunID string `json:"run_id"`
ID string `json:"id"`
StartedAt int64 `json:"started_at"`
FinishedAt int64 `json:"finished_at"`
Expand All @@ -23,10 +22,9 @@ type basicTask struct {
Error string `json:"error"`
}

func newBasicTask(index int64, runID string, task Task) *basicTask {
func newBasicTask(index int64, task Task) *basicTask {
return &basicTask{
Index: index,
RunID: runID,
ID: uuid.New().String(),
StartedAt: 0,
FinishedAt: 0,
Expand Down

0 comments on commit f10ebcd

Please sign in to comment.