Skip to content

Commit

Permalink
worker_local: address review
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k committed Oct 28, 2020
1 parent 96c5ff7 commit 4cf00b8
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions extern/sector-storage/worker_local.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,16 @@ type WorkerConfig struct {
NoSwap bool
}

// used do provide custom proofs impl (mostly used in testing)
type ExecutorFunc func() (ffiwrapper.Storage, error)

type LocalWorker struct {
scfg *ffiwrapper.Config
storage stores.Store
localStore *stores.Local
sindex stores.SectorIndex
ret storiface.WorkerReturn
executor func() (ffiwrapper.Storage, error)
executor ExecutorFunc
noSwap bool

ct *workerCallTracker
Expand All @@ -52,7 +55,7 @@ type LocalWorker struct {
closing chan struct{}
}

func newLocalWorker(executor func() (ffiwrapper.Storage, error), wcfg WorkerConfig, store stores.Store, local *stores.Local, sindex stores.SectorIndex, ret storiface.WorkerReturn, cst *statestore.StateStore) *LocalWorker {
func newLocalWorker(executor ExecutorFunc, wcfg WorkerConfig, store stores.Store, local *stores.Local, sindex stores.SectorIndex, ret storiface.WorkerReturn, cst *statestore.StateStore) *LocalWorker {
acceptTasks := map[sealtasks.TaskType]struct{}{}
for _, taskType := range wcfg.TaskTypes {
acceptTasks[taskType] = struct{}{}
Expand Down

0 comments on commit 4cf00b8

Please sign in to comment.