Skip to content

Commit

Permalink
feat: optimize api for shceduling (#3660)
Browse files Browse the repository at this point in the history
Signed-off-by: Gaius <[email protected]>
  • Loading branch information
gaius-qi authored Nov 22, 2024
1 parent c05bff9 commit 9376c5d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module d7y.io/dragonfly/v2
go 1.23.0

require (
d7y.io/api/v2 v2.0.171
d7y.io/api/v2 v2.0.173
github.com/MysteriousPotato/go-lockable v1.0.0
github.com/RichardKnop/machinery v1.10.8
github.com/Showmax/go-fqdn v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo
cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk=
cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs=
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
d7y.io/api/v2 v2.0.171 h1:iHMAhim/BFJ6MhZzsGMmVqF/h0Atw59g/0GuYFyhGxg=
d7y.io/api/v2 v2.0.171/go.mod h1:HLM5CjwBmy1pDGNUsUNkQeQPItblnHmeTJBEvBDbGnE=
d7y.io/api/v2 v2.0.173 h1:eSEAdrjINtQI8frgFYD4YBNE3XBlySzsDHxrq7QXMoA=
d7y.io/api/v2 v2.0.173/go.mod h1:HLM5CjwBmy1pDGNUsUNkQeQPItblnHmeTJBEvBDbGnE=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U=
Expand Down
2 changes: 1 addition & 1 deletion scheduler/resource/persistentcache/host_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ func (h *hostManager) Load(ctx context.Context, hostID string) (*Host, bool) {
}

// Set time fields from raw host.
announceInterval, err := strconv.ParseInt(rawHost["announce_interval"], 10, 32)
announceInterval, err := strconv.ParseUint(rawHost["announce_interval"], 10, 64)
if err != nil {
log.Errorf("parsing announce interval failed: %v", err)
return nil, false
Expand Down
2 changes: 1 addition & 1 deletion scheduler/resource/persistentcache/peer_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (p *peerManager) Load(ctx context.Context, peerID string) (*Peer, bool) {
}

// Set time fields from raw task.
cost, err := strconv.ParseInt(rawPeer["cost"], 10, 32)
cost, err := strconv.ParseUint(rawPeer["cost"], 10, 64)
if err != nil {
log.Errorf("parsing cost failed: %v", err)
return nil, false
Expand Down
2 changes: 1 addition & 1 deletion scheduler/resource/persistentcache/task_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (t *taskManager) Load(ctx context.Context, taskID string) (*Task, bool) {
}

// Set time fields from raw task.
ttl, err := strconv.ParseInt(rawTask["ttl"], 10, 32)
ttl, err := strconv.ParseUint(rawTask["ttl"], 10, 64)
if err != nil {
log.Errorf("parsing ttl failed: %v", err)
return nil, false
Expand Down

0 comments on commit 9376c5d

Please sign in to comment.