refactor: call renterd earlier but wait until its ready

This commit is contained in:
Derrick Hammer 2023-05-04 04:20:39 -04:00
parent b16beebabb
commit ca3d3588a4
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 7 additions and 5 deletions

View File

@ -38,6 +38,11 @@ func main() {
// Initialize the database connection
db.Init()
// Start the renterd process in a goroutine
go renterd.Main()
renterd.Ready()
// Create a new Iris app instance
app := iris.New()
@ -76,9 +81,6 @@ func main() {
// And the wildcard one for index.html, *.js, *.css and e.t.c.
app.Get("/swagger/{any:path}", swaggerUI)
// Start the renterd process in a goroutine
//go renterd.Main()
// Start the Iris app and listen for incoming requests on port 80
log.Fatal(app.Listen(":8080", func(app *iris.Application) {
routes := app.GetRoutes()