Browse Source

En cours de développement

master
losyme 5 months ago
parent
commit
028c4cfa0a
  1. 4
      go.mod
  2. 8
      go.sum
  3. 16
      internal/application/application.go

4
go.mod

@ -6,12 +6,12 @@ require (
forge.chapril.org/dune/jw v0.0.0-20211205143034-b316149dd167
forge.chapril.org/dune/sdk v0.0.0-20211205143121-15eea5fca05a
forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015
forge.chapril.org/losyme/cmdline v0.0.0-20211029192907-e6f74788c44f
forge.chapril.org/losyme/cmdline v0.0.0-20211205162853-bbfce16ddfa4
forge.chapril.org/losyme/config v0.0.0-20211205154014-06de4cde67a6
forge.chapril.org/losyme/errors v0.0.0-20211003204336-ad5510c24b40
forge.chapril.org/losyme/kong v0.0.0-20211205154055-bf4a6a1aa2f7
forge.chapril.org/losyme/logger v0.0.0-20211119225711-ee831caaf5d4
forge.chapril.org/losyme/minikit v0.0.0-20211205155148-984950a34eda
forge.chapril.org/losyme/minikit v0.0.0-20211205163516-72357706601e
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf
forge.chapril.org/losyme/util v0.0.0-20211205153848-3e13eadb49eb
forge.chapril.org/losyme/uuid v0.0.0-20211007082235-8d502169e034

8
go.sum

@ -6,8 +6,8 @@ forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015 h1:mZQ2k
forge.chapril.org/losyme/application v0.0.0-20211029102910-b7db6effc015/go.mod h1:olQo5n5tnBRHq0wcc0lNbymvsXdTuYaCjNfd2d/+01w=
forge.chapril.org/losyme/buffer v0.0.0-20211003203540-771701f5a518 h1:B7wu0DWUwpt0Mw/VTuWQZikhV/VD6kc2iJWbIY+jgEM=
forge.chapril.org/losyme/buffer v0.0.0-20211003203540-771701f5a518/go.mod h1:4Yl585hmF3bWZfuwGF2Ym8ErykJZiF9yawlmK7szIkc=
forge.chapril.org/losyme/cmdline v0.0.0-20211029192907-e6f74788c44f h1:7m6EpAj3iSvPiRd0mbrxwJ6TI0vMRRrp7M8PFq7AIXI=
forge.chapril.org/losyme/cmdline v0.0.0-20211029192907-e6f74788c44f/go.mod h1:NvAXbqc+LzdATB2GY72fvK4q2EtxxanmrNs03H7+Do4=
forge.chapril.org/losyme/cmdline v0.0.0-20211205162853-bbfce16ddfa4 h1:adO9qMU7nu/ndrZmyKFQPul8OaBoE5uqkgx701g36Bk=
forge.chapril.org/losyme/cmdline v0.0.0-20211205162853-bbfce16ddfa4/go.mod h1:NvAXbqc+LzdATB2GY72fvK4q2EtxxanmrNs03H7+Do4=
forge.chapril.org/losyme/config v0.0.0-20211205154014-06de4cde67a6 h1:ryXwFzFY7WjRZPEhrrn/Bcn6LVhdNmrXpb26SAiiwGQ=
forge.chapril.org/losyme/config v0.0.0-20211205154014-06de4cde67a6/go.mod h1:DGn0ueEigyU4tI9unlnjDheP2JnzvziOB89ILU/hHKk=
forge.chapril.org/losyme/crypto v0.0.0-20211003213528-e97d4ebea720 h1:tMwzjPmGvBb5/5Cx0OIPKqT9zMMR6gQn6398rwT0ghc=
@ -20,8 +20,8 @@ forge.chapril.org/losyme/kvfmt v0.0.0-20211003204256-34ac32764dae h1:RdYWXKy+OQN
forge.chapril.org/losyme/kvfmt v0.0.0-20211003204256-34ac32764dae/go.mod h1:wnVjwnCO2vFLLZ1EgFuFws1n8XLluufsGsdozGYSA7c=
forge.chapril.org/losyme/logger v0.0.0-20211119225711-ee831caaf5d4 h1:+5xllpRoYR2wNkBd5FSACEcf7ZSDk6Nm4Y/qFSCvISE=
forge.chapril.org/losyme/logger v0.0.0-20211119225711-ee831caaf5d4/go.mod h1:a3fN8yTjq5S/ramr03hIkutKM/35UsijUgRNKHjjlMU=
forge.chapril.org/losyme/minikit v0.0.0-20211205155148-984950a34eda h1:sHILEVTuzTcQ6RvXeGkcVL39xVqhT0RzxIXj7T4Dp0g=
forge.chapril.org/losyme/minikit v0.0.0-20211205155148-984950a34eda/go.mod h1:ikaGjjiILzv3Btu9gGkv4Wh3F2suGTTt0I0uemVNGjM=
forge.chapril.org/losyme/minikit v0.0.0-20211205163516-72357706601e h1:tmrunAwv9Htw4LhiMVq4kxUgimKrf/+Ok4je/xgNw58=
forge.chapril.org/losyme/minikit v0.0.0-20211205163516-72357706601e/go.mod h1:hW86dTmffZxa6NyBMi6ZwdYpwAlCK7E5Y7lYjBq18wc=
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf h1:5OIlwVBTdvjCXh2JHAh5rq8FgSe1lXuuKDFtO/ZRaRM=
forge.chapril.org/losyme/scheduler v0.0.0-20211003204604-f14dada88faf/go.mod h1:VNjFKl0Q2vvLDnR9tdNdTIZDLQNlR+gcIGNf2aIYv3o=
forge.chapril.org/losyme/util v0.0.0-20211205153848-3e13eadb49eb h1:zJ8AFh3nkvoLfwqXrRbSgJTqMhYTxdETrzkUFXGLoOM=

16
internal/application/application.go

@ -60,6 +60,8 @@ func New(name, version, builtAt string, args []string) *Application {
func (app *Application) Run() error {
return app.minikit.Run(
func() error {
cs := app.components
if fn := app.cmdLine.runAfter; fn != nil {
if err := fn(); err != nil {
return errors.WithMessage(err, "runAfter") /////////////////////////////////////////////////////////
@ -70,6 +72,12 @@ func (app *Application) Run() error {
return errors.WithMessage(err, "storage") //////////////////////////////////////////////////////////////
}
defer func() {
if err := cs.Storage.Close(); err != nil {
cs.Logger.Error("Error when closing storage", "reason", err) //:::::::::::::::::::::::::::::::::::::
}
}()
if err := app.model(); err != nil {
return errors.WithMessage(err, "model") ////////////////////////////////////////////////////////////////
}
@ -78,14 +86,14 @@ func (app *Application) Run() error {
return errors.WithMessage(err, "API") //////////////////////////////////////////////////////////////////
}
cs := app.components
if app.cmdLine.demo {
if err := app.demo(); err != nil {
return errors.WithMessage(err, "demo") /////////////////////////////////////////////////////////////
}
cs.Demo.Start()
defer cs.Demo.Stop()
}
app.components.Scheduler.Start()
@ -95,10 +103,6 @@ func (app *Application) Run() error {
cs := app.components
<-cs.Scheduler.Stop().Done()
if app.cmdLine.demo {
cs.Demo.Stop()
}
},
_serverShutdownTimeout,
)

Loading…
Cancel
Save