This commit is contained in:
Andrew Jackson (Ajax) 2023-12-11 21:10:15 -06:00
parent 0bad4d910d
commit 0175faf5c2
4 changed files with 10 additions and 5 deletions

View File

@ -83,8 +83,8 @@ func StorageAuth(apiKey string) (sealer.StorageAuth, error) {
}
func GetDeps(ctx context.Context, cctx *cli.Context) (*Deps, error) {
var deps *Deps
return deps, deps.PopulateRemainingDeps(ctx, cctx, true)
var deps Deps
return &deps, deps.PopulateRemainingDeps(ctx, cctx, true)
}
type Deps struct {
@ -107,6 +107,9 @@ const (
func (deps *Deps) PopulateRemainingDeps(ctx context.Context, cctx *cli.Context, makeRepo bool) error {
if deps == nil {
*deps = Deps{}
}
var err error
if makeRepo {
// Open repo

View File

@ -135,5 +135,6 @@ func ListenAndServe(ctx context.Context, dependencies *deps.Deps, shutdownChan c
log.Warn("Graceful shutdown successful")
}()
log.Infof("Setting up RPC server at %s", dependencies.ListenAddr)
return srv.ListenAndServe()
}

View File

@ -113,11 +113,12 @@ var runCmd = &cli.Command{
}
}
var dependencies *deps.Deps
err = dependencies.PopulateRemainingDeps(ctx, cctx, true)
var deps deps.Deps
err = deps.PopulateRemainingDeps(ctx, cctx, true)
if err != nil {
return err
}
dependencies := &deps
taskEngine, err := tasks.StartTasks(ctx, dependencies)
@ -136,4 +137,4 @@ var runCmd = &cli.Command{
<-finishCh
return nil
},
}
}