Commit 69c7af17 authored by Will Cory's avatar Will Cory

feat(indexer): add indexer all command

parent 4169c1fb
......@@ -76,6 +76,18 @@ func runApi(ctx *cli.Context) error {
return api.Listen(apiCtx, cfg.API.Port)
}
func runAll(ctx *cli.Context) error {
// Run the indexer
go func() {
if err := runIndexer(ctx); err != nil {
log.NewLogger(log.ReadCLIConfig(ctx)).Error("Error running the indexer", "err", err)
}
}()
// Run the API and return its error, if any
return runApi(ctx)
}
func newCli(GitCommit string, GitDate string) *cli.App {
flags := []cli.Flag{ConfigFlag}
flags = append(flags, log.CLIFlags("INDEXER")...)
......@@ -104,6 +116,12 @@ func newCli(GitCommit string, GitDate string) *cli.App {
return nil
},
},
{
Name: "all",
Flags: flags,
Description: "Runs both the api service and the indexing service",
Action: runAll,
},
},
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment