diff options
Diffstat (limited to 'matterclient/helpers.go')
-rw-r--r-- | matterclient/helpers.go | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/matterclient/helpers.go b/matterclient/helpers.go index c3d33145..d5b1038a 100644 --- a/matterclient/helpers.go +++ b/matterclient/helpers.go @@ -186,15 +186,19 @@ func (m *MMClient) serverAlive(firstConnection bool, b *backoff.Backoff) error { if resp.Error != nil { return fmt.Errorf("%#v", resp.Error.Error()) } - if firstConnection && !supportedVersion(resp.ServerVersion) { + if firstConnection && !m.SkipVersionCheck && !supportedVersion(resp.ServerVersion) { return fmt.Errorf("unsupported mattermost version: %s", resp.ServerVersion) } - m.ServerVersion = resp.ServerVersion - if m.ServerVersion == "" { - m.logger.Debugf("Server not up yet, reconnecting in %s", d) - time.Sleep(d) + if !m.SkipVersionCheck { + m.ServerVersion = resp.ServerVersion + if m.ServerVersion == "" { + m.logger.Debugf("Server not up yet, reconnecting in %s", d) + time.Sleep(d) + } else { + m.logger.Infof("Found version %s", m.ServerVersion) + return nil + } } else { - m.logger.Infof("Found version %s", m.ServerVersion) return nil } } |