fix: move stop() inside goroutine

This commit is contained in:
Gaze
2024-04-17 17:16:52 +07:00
parent 56e3a780cd
commit 1c597f740c

View File

@@ -117,10 +117,9 @@ func runHandler(opts *runCmdOptions, cmd *cobra.Command, _ []string) error {
if err := bitcoinIndexer.Run(ctx); err != nil {
logger.ErrorContext(ctx, "Failed to run Bitcoin Indexer", slogx.Error(err))
}
// stop main process if Bitcoin Indexer failed
stop()
}()
// stop main process if Bitcoin Indexer failed
stop()
}
// Wait for interrupt signal to gracefully stop the server with