24 lines
391 B
Go
24 lines
391 B
Go
package runtime
|
|
|
|
import (
|
|
"context"
|
|
|
|
"git.sendico.io/tech/sxchnge/product/app/health/status"
|
|
)
|
|
|
|
func (a *instance) Finish(ctx context.Context) error {
|
|
a.once.Do(func() {
|
|
if a.health != nil {
|
|
a.health.SetStatus(health.SSTerminating)
|
|
a.health.Finish()
|
|
}
|
|
if a.cleanup != nil {
|
|
a.finishErr = a.cleanup(ctx)
|
|
}
|
|
if a.mw != nil {
|
|
a.mw.Finish()
|
|
}
|
|
})
|
|
return a.finishErr
|
|
}
|