diff options
author | Alex Vandiver <github@chmrr.net> | 2021-10-23 14:46:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-23 23:46:27 +0200 |
commit | e3ffbcadd82d71e87e7f5841f9a037f9358a010b (patch) | |
tree | 82b5e6588254d587e07ff23541090f46527cc8f5 /matterbridge.go | |
parent | b7d73077e5944056c1078ed22a3211e6a11ffad4 (diff) | |
download | matterbridge-msglm-e3ffbcadd82d71e87e7f5841f9a037f9358a010b.tar.gz matterbridge-msglm-e3ffbcadd82d71e87e7f5841f9a037f9358a010b.tar.bz2 matterbridge-msglm-e3ffbcadd82d71e87e7f5841f9a037f9358a010b.zip |
Add better error handling on Zulip (#1589)
* zulip: Treat unknown errors with a 10-second backoff.
An unknown error (including an unauthorized error) would fall through
with no calls to time.Sleep, resulting in hammering the server as
quickly as possible.
Add a 10-second sleep in the default error case. The heartbeat is
left with no explicit sleep, but all other codepaths now contain one.
* version: Move version information into a separate package.
This will allow it to be accessed by other sections of the code.
* zulip: Use the matterbridge version in the user-agent.
Co-authored-by: Wim <wim@42.be>
Diffstat (limited to 'matterbridge.go')
-rw-r--r-- | matterbridge.go | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/matterbridge.go b/matterbridge.go index b9b7d6d3..7ab29784 100644 --- a/matterbridge.go +++ b/matterbridge.go @@ -10,15 +10,13 @@ import ( "github.com/42wim/matterbridge/bridge/config" "github.com/42wim/matterbridge/gateway" "github.com/42wim/matterbridge/gateway/bridgemap" + "github.com/42wim/matterbridge/version" "github.com/google/gops/agent" prefixed "github.com/matterbridge/logrus-prefixed-formatter" "github.com/sirupsen/logrus" ) var ( - version = "1.23.1-dev" - githash string - flagConfig = flag.String("conf", "matterbridge.toml", "config file") flagDebug = flag.Bool("debug", false, "enable debug") flagVersion = flag.Bool("version", false, "show version") @@ -28,7 +26,7 @@ var ( func main() { flag.Parse() if *flagVersion { - fmt.Printf("version: %s %s\n", version, githash) + fmt.Printf("version: %s %s\n", version.Release, version.GitHash) return } @@ -43,8 +41,8 @@ func main() { } } - logger.Printf("Running version %s %s", version, githash) - if strings.Contains(version, "-dev") { + logger.Printf("Running version %s %s", version.Release, version.GitHash) + if strings.Contains(version.Release, "-dev") { logger.Println("WARNING: THIS IS A DEVELOPMENT VERSION. Things may break.") } |