Skip to content

Commit

Permalink
Merge pull request #10208 from filecoin-project/fix/seal-delay-seconds
Browse files Browse the repository at this point in the history
fix: cli: option to set-seal-delay in seconds
  • Loading branch information
magik6k authored Feb 9, 2023
2 parents cb8e283 + bd4dc21 commit 25babac
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
17 changes: 14 additions & 3 deletions cmd/lotus-miner/sectors.go
Original file line number Diff line number Diff line change
Expand Up @@ -1379,8 +1379,14 @@ var sectorsStartSealCmd = &cli.Command{

var sectorsSealDelayCmd = &cli.Command{
Name: "set-seal-delay",
Usage: "Set the time, in minutes, that a new sector waits for deals before sealing starts",
ArgsUsage: "<minutes>",
Usage: "Set the time (in minutes) that a new sector waits for deals before sealing starts",
ArgsUsage: "<time>",
Flags: []cli.Flag{
&cli.BoolFlag{
Name: "seconds",
Usage: "Specifies that the time argument should be in seconds",
},
},
Action: func(cctx *cli.Context) error {
minerAPI, closer, err := lcli.GetStorageMinerAPI(cctx)
if err != nil {
Expand All @@ -1397,7 +1403,12 @@ var sectorsSealDelayCmd = &cli.Command{
return xerrors.Errorf("could not parse sector number: %w", err)
}

delay := hs * uint64(time.Minute)
var delay uint64
if cctx.Bool("seconds") {
delay = hs * uint64(time.Second)
} else {
delay = hs * uint64(time.Minute)
}

return minerAPI.SectorSetSealDelay(ctx, time.Duration(delay))
},
Expand Down
8 changes: 4 additions & 4 deletions documentation/en/cli-lotus-miner.md
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@ COMMANDS:
snap-up Mark a committed capacity sector to be filled with deals
abort-upgrade Abort the attempted (SnapDeals) upgrade of a CC sector, reverting it to as before
seal Manually start sealing a sector (filling any unused space with junk)
set-seal-delay Set the time, in minutes, that a new sector waits for deals before sealing starts
set-seal-delay Set the time (in minutes) that a new sector waits for deals before sealing starts
get-cc-collateral Get the collateral required to pledge a committed capacity sector
batching manage batch sector operations
match-pending-pieces force a refreshed match of pending pieces to open sectors without manually waiting for more deals
Expand Down Expand Up @@ -2002,13 +2002,13 @@ OPTIONS:
### lotus-miner sectors set-seal-delay
```
NAME:
lotus-miner sectors set-seal-delay - Set the time, in minutes, that a new sector waits for deals before sealing starts
lotus-miner sectors set-seal-delay - Set the time (in minutes) that a new sector waits for deals before sealing starts
USAGE:
lotus-miner sectors set-seal-delay [command options] <minutes>
lotus-miner sectors set-seal-delay [command options] <time>
OPTIONS:
--help, -h show help (default: false)
--seconds Specifies that the time argument should be in seconds (default: false)
```

Expand Down

0 comments on commit 25babac

Please sign in to comment.