Skip to content

Commit

Permalink
refactor: refactor message handling and update dependencies
Browse files Browse the repository at this point in the history
- Update dependencies in `go.mod` to newer versions
- Add `github.com/jpillora/backoff` as an indirect dependency
- Change `queue.NewConsumer` to `queue.NewRing` in `main.go`
- Remove unnecessary type conversion for `WorkerNum` in `main.go`
- Add `Payload` method to `PushNotification` in `notification.go`
- Change `QueuedMessage` to `TaskMessage` in `SendNotification` function
- Modify JSON unmarshal to use `Payload` method in `SendNotification`
- Update `Run` function to use `TaskMessage` instead of `QueuedMessage`
- Update `server_test.go` to use `TaskMessage` instead of `QueuedMessage`
- Change data types in `status.go` for `BusyWorkers`, `SuccessTasks`, `FailureTasks`, and `SubmittedTasks`

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Jan 22, 2025
1 parent 1e19b9e commit c16bef9
Show file tree
Hide file tree
Showing 6 changed files with 92 additions and 26 deletions.
9 changes: 5 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ require (
github.com/dgraph-io/badger/v4 v4.2.0
github.com/gin-contrib/logger v1.1.0
github.com/gin-gonic/gin v1.10.0
github.com/golang-queue/nats v0.1.0
github.com/golang-queue/nsq v0.2.0
github.com/golang-queue/queue v0.1.4-0.20221230133718-0314ef173f98
github.com/golang-queue/redisdb-stream v0.1.0
github.com/golang-queue/nats v0.2.0
github.com/golang-queue/nsq v0.3.0
github.com/golang-queue/queue v0.3.0
github.com/golang-queue/redisdb-stream v0.3.0
github.com/golang/protobuf v1.5.4
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
Expand Down Expand Up @@ -97,6 +97,7 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.4 // indirect
github.com/googleapis/gax-go/v2 v2.14.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/klauspost/compress v1.17.11 // indirect
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
Expand Down
Loading

0 comments on commit c16bef9

Please sign in to comment.