Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: cli: option to set-seal-delay in seconds #10208

Merged
merged 2 commits into from
Feb 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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