diff --git a/internal/app/bridge/bridge.go b/internal/app/bridge/bridge.go index ac19deb9..d983b010 100644 --- a/internal/app/bridge/bridge.go +++ b/internal/app/bridge/bridge.go @@ -139,7 +139,7 @@ func run(b *base.Base, c *cli.Context) error { // nolint[funlen] // Watch for updates routine go func() { - ticker := time.NewTicker(time.Hour) + ticker := time.NewTicker(constants.UpdateCheckInterval) for { checkAndHandleUpdate(b.Updater, f, b.Settings.GetBool(settings.AutoUpdateKey)) diff --git a/internal/constants/update_default.go b/internal/constants/update_default.go new file mode 100644 index 00000000..81b61e73 --- /dev/null +++ b/internal/constants/update_default.go @@ -0,0 +1,28 @@ +// Copyright (c) 2021 Proton Technologies AG +// +// This file is part of ProtonMail Bridge. +// +// ProtonMail Bridge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ProtonMail Bridge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ProtonMail Bridge. If not, see . + +// +build !build_qa + +package constants + +import "time" + +// nolint[gochecknoglobals] +var ( + // UpdateCheckInterval defines how often we check for new version + UpdateCheckInterval = time.Hour //nolint[gochecknoglobals] +) diff --git a/internal/constants/update_qa.go b/internal/constants/update_qa.go new file mode 100644 index 00000000..5f098f0b --- /dev/null +++ b/internal/constants/update_qa.go @@ -0,0 +1,28 @@ +// Copyright (c) 2021 Proton Technologies AG +// +// This file is part of ProtonMail Bridge. +// +// ProtonMail Bridge is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// ProtonMail Bridge is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with ProtonMail Bridge. If not, see . + +// +build build_qa + +package constants + +import "time" + +// nolint[gochecknoglobals] +var ( + // UpdateCheckInterval defines how often we check for new version + UpdateCheckInterval = time.Duration(5 * time.Minute) +)