refactor: call renterd earlier but wait until its ready
This commit is contained in:
parent
b16beebabb
commit
ca3d3588a4
12
main.go
12
main.go
|
@ -29,8 +29,8 @@ var embedFrontend embed.FS
|
||||||
// @license.name MIT
|
// @license.name MIT
|
||||||
// @license.url https://opensource.org/license/mit/
|
// @license.url https://opensource.org/license/mit/
|
||||||
|
|
||||||
// @externalDocs.description OpenAPI
|
// @externalDocs.description OpenAPI
|
||||||
// @externalDocs.url https://swagger.io/resources/open-api/
|
// @externalDocs.url https://swagger.io/resources/open-api/
|
||||||
func main() {
|
func main() {
|
||||||
// Initialize the configuration settings
|
// Initialize the configuration settings
|
||||||
config.Init()
|
config.Init()
|
||||||
|
@ -38,6 +38,11 @@ func main() {
|
||||||
// Initialize the database connection
|
// Initialize the database connection
|
||||||
db.Init()
|
db.Init()
|
||||||
|
|
||||||
|
// Start the renterd process in a goroutine
|
||||||
|
go renterd.Main()
|
||||||
|
|
||||||
|
renterd.Ready()
|
||||||
|
|
||||||
// Create a new Iris app instance
|
// Create a new Iris app instance
|
||||||
app := iris.New()
|
app := iris.New()
|
||||||
|
|
||||||
|
@ -76,9 +81,6 @@ func main() {
|
||||||
// And the wildcard one for index.html, *.js, *.css and e.t.c.
|
// And the wildcard one for index.html, *.js, *.css and e.t.c.
|
||||||
app.Get("/swagger/{any:path}", swaggerUI)
|
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
|
// Start the Iris app and listen for incoming requests on port 80
|
||||||
log.Fatal(app.Listen(":8080", func(app *iris.Application) {
|
log.Fatal(app.Listen(":8080", func(app *iris.Application) {
|
||||||
routes := app.GetRoutes()
|
routes := app.GetRoutes()
|
||||||
|
|
Loading…
Reference in New Issue