Added cluster node check
This commit is contained in:
parent
40ef5c76ec
commit
49791a836e
5
main.go
5
main.go
@ -58,6 +58,11 @@ func configure(app *aero.Application) *aero.Application {
|
|||||||
// Close the database node on shutdown
|
// Close the database node on shutdown
|
||||||
app.OnShutdown(arn.Node.Close)
|
app.OnShutdown(arn.Node.Close)
|
||||||
|
|
||||||
|
// Check that this is the server
|
||||||
|
if !arn.Node.IsServer() {
|
||||||
|
panic("Another program is currently running as the database server")
|
||||||
|
}
|
||||||
|
|
||||||
// Prefetch all collections
|
// Prefetch all collections
|
||||||
arn.DB.Prefetch()
|
arn.DB.Prefetch()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user