2024-01-22 17:22:41: merge [master:56d3e06e49d7a75f142424293788a4f3b6245430];
This commit is contained in:
1 parent
7014f56cbb
commit
2b91caece0
60 files changed
+3558
No files matched your search
@@ -0,0 +1,37 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/integration-system/isp-kit/bootstrap"
|
||||
"github.com/integration-system/isp-kit/shutdown"
|
||||
"isp-gate-service/assembly"
|
||||
"isp-gate-service/conf"
|
||||
)
|
||||
|
||||
var (
|
||||
version = "1.0.0"
|
||||
)
|
||||
|
||||
func main() {
|
||||
boot := bootstrap.New(version, conf.Remote{}, nil)
|
||||
app := boot.App
|
||||
logger := app.Logger()
|
||||
|
||||
assembly, err := assembly.New(boot)
|
||||
if err != nil {
|
||||
logger.Fatal(app.Context(), err)
|
||||
}
|
||||
app.AddRunners(assembly.Runners()...)
|
||||
app.AddClosers(assembly.Closers()...)
|
||||
|
||||
shutdown.On(func() {
|
||||
logger.Info(app.Context(), "starting shutdown")
|
||||
app.Shutdown()
|
||||
logger.Info(app.Context(), "shutdown completed")
|
||||
})
|
||||
|
||||
err = app.Run()
|
||||
if err != nil {
|
||||
app.Shutdown()
|
||||
logger.Fatal(app.Context(), err)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user