GODT-1490: Update go sentry and openpgp

This commit is contained in:
Jakub
2022-01-07 13:21:17 +01:00
parent 22f427d522
commit e9c05c5a6b
6 changed files with 46 additions and 20 deletions

View File

@ -358,10 +358,13 @@ func (b *Base) wrapMainLoop(appMainLoop func(*Base, *cli.Context) error) cli.Act
Info("Run app")
b.CrashHandler.AddRecoveryAction(func(interface{}) error {
sentry.Flush(2 * time.Second)
if c.Int(flagRestart) > maxAllowedRestarts {
logrus.
WithField("restart", c.Int("restart")).
Warn("Not restarting, already restarted too many times")
os.Exit(1)
return nil
}

View File

@ -33,6 +33,7 @@ func (b *Base) restartApp(crash bool) error {
if crash {
args = incrementRestartFlag(os.Args)[1:]
defer func() { os.Exit(1) }()
} else {
args = os.Args[1:]
}

View File

@ -175,3 +175,7 @@ func isFunctionFilteredOut(function string) bool {
}
return false
}
func Flush(maxWaiTime time.Duration) {
sentry.Flush(maxWaiTime)
}