Skip to content

Commit

Permalink
Merge pull request #184 from FogMeta/main
Browse files Browse the repository at this point in the history
Improve: support manual-bid deal
  • Loading branch information
Normalnoise committed Jan 3, 2023
2 parents 12ae3db + ca50885 commit f5e3ef2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions command/auto.go
Expand Up @@ -416,8 +416,9 @@ func (cmdAutoBidDeal *CmdAutoBidDeal) SendAutoBidDealsBySwanClientSourceId(input
SourceId: &sourceId,
}

var totalCount, successCount int
timeout := time.After(60 * time.Minute)
tick := time.Tick(10 * time.Second)
var totalCount, successCount int
for {
select {
case <-tick:
Expand All @@ -442,7 +443,7 @@ func (cmdAutoBidDeal *CmdAutoBidDeal) SendAutoBidDealsBySwanClientSourceId(input
if totalCount == total {
goto END
}
case <-time.After(30 * time.Minute):
case <-timeout:
goto END
}
}
Expand Down
4 changes: 3 additions & 1 deletion command/deal.go
Expand Up @@ -161,7 +161,9 @@ func (cmdDeal *CmdDeal) SendDeals() ([]*libmodel.FileDesc, error) {

minerFids := make([]string, 0)
for _, bid := range task.Data.Bids {
minerFids = append(minerFids, bid.MinerFid)
if len(strings.TrimSpace(bid.MinerFid)) != 0 {
minerFids = append(minerFids, bid.MinerFid)
}
}

if len(cmdDeal.MinerFids) > 0 {
Expand Down

0 comments on commit f5e3ef2

Please sign in to comment.