This commit is contained in:
Shrenuj Bansal
2023-08-30 12:11:09 -04:00
parent eacd5bb970
commit c0bd13eced
3 changed files with 41 additions and 19 deletions
+13
View File
@@ -6,6 +6,7 @@ import (
"errors"
"fmt"
"github.com/filecoin-project/lotus/lib/harmony/harmonydb"
"github.com/filecoin-project/lotus/lib/harmony/harmonytask"
"net/http"
"os"
"path/filepath"
@@ -322,6 +323,18 @@ func WindowPostScheduler(fc config.MinerFeeConfig, pc config.ProvingConfig) func
return nil, err
}
wdPostTask := wdpost.NewWdPostTask(db)
tasks := []harmonytask.TaskInterface{wdPostTask}
taskEngine, err := harmonytask.New(db, []harmonytask.TaskInterface{wdPostTask}, "localhost:12300")
if err != nil {
return nil, xerrors.Errorf("failed to create task engine: %w", err)
}
//handler := gin.New()
//
//taskEngine.ApplyHttpHandlers(handler.Group("/"))
defer taskEngine.GracefullyTerminate(time.Hour)
lc.Append(fx.Hook{
OnStart: func(context.Context) error {
go fps.Run(ctx)