forked from Silverfish/proton-bridge
GODT-1490: Update go sentry and openpgp
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
@ -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:]
|
||||
}
|
||||
|
||||
@ -175,3 +175,7 @@ func isFunctionFilteredOut(function string) bool {
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func Flush(maxWaiTime time.Duration) {
|
||||
sentry.Flush(maxWaiTime)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user