Update storage-FSM, add API to set sector seal delay
This commit is contained in:
+13
-3
@@ -3,12 +3,12 @@ package impl
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
"net/http"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"github.com/ipfs/go-cid"
|
||||
"golang.org/x/xerrors"
|
||||
"time"
|
||||
|
||||
"github.com/filecoin-project/go-address"
|
||||
storagemarket "github.com/filecoin-project/go-fil-markets/storagemarket"
|
||||
@@ -53,6 +53,8 @@ type StorageMinerAPI struct {
|
||||
SetConsiderOfflineStorageDealsConfigFunc dtypes.SetConsiderOfflineStorageDealsConfigFunc
|
||||
ConsiderOfflineRetrievalDealsConfigFunc dtypes.ConsiderOfflineRetrievalDealsConfigFunc
|
||||
SetConsiderOfflineRetrievalDealsConfigFunc dtypes.SetConsiderOfflineRetrievalDealsConfigFunc
|
||||
SetSealingDelayFunc dtypes.SetSealingDelayFunc
|
||||
GetSealingDelayFunc dtypes.GetSealingDelayFunc
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) ServeRemote(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -181,6 +183,14 @@ func (sm *StorageMinerAPI) SectorStartSealing(ctx context.Context, number abi.Se
|
||||
return sm.Miner.StartPackingSector(number)
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) SectorSetSealDelay(ctx context.Context, delay time.Duration) error {
|
||||
return sm.SetSealingDelayFunc(delay)
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) SectorGetSealDelay(ctx context.Context) (time.Duration, error) {
|
||||
return sm.GetSealingDelayFunc()
|
||||
}
|
||||
|
||||
func (sm *StorageMinerAPI) SectorsUpdate(ctx context.Context, id abi.SectorNumber, state api.SectorState) error {
|
||||
return sm.Miner.ForceSectorState(ctx, id, sealing.SectorState(state))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user