mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #11238 from grafana/11155-mysql-issue
middleware: recover and retry on session start
This commit is contained in:
commit
a8918047a2
@ -105,6 +105,18 @@ type SessionWrapper struct {
|
||||
}
|
||||
|
||||
func (s *SessionWrapper) Start(c *macaron.Context) error {
|
||||
// See https://github.com/grafana/grafana/issues/11155 for details on why
|
||||
// a recover and retry is needed
|
||||
defer func() error {
|
||||
if err := recover(); err != nil {
|
||||
var retryErr error
|
||||
s.session, retryErr = s.manager.Start(c)
|
||||
return retryErr
|
||||
}
|
||||
|
||||
return nil
|
||||
}()
|
||||
|
||||
var err error
|
||||
s.session, err = s.manager.Start(c)
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user