Added node close on shutdown

This commit is contained in:
Eduard Urbach 2017-11-02 04:08:45 +01:00
parent 2de358c843
commit 94b3fd997e

View File

@ -207,9 +207,6 @@ func configure(app *aero.Application) *aero.Application {
middleware.UserInfo(), middleware.UserInfo(),
) )
// Database
arn.DB.PrefetchData()
// API // API
arn.API.Install(app) arn.API.Install(app)
@ -221,6 +218,12 @@ func configure(app *aero.Application) *aero.Application {
// Authentication // Authentication
auth.Install(app) auth.Install(app)
// Close the database node on shutdown
app.OnShutdown(arn.Node.Close)
// Prefetch data from all collections
arn.DB.PrefetchData()
// Specify test routes // Specify test routes
for route, examples := range routeTests { for route, examples := range routeTests {
app.Test(route, examples) app.Test(route, examples)