reduce warnings during normal shutdown
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include "backoff.h"
+#include <vespa/vespalib/util/signalhandler.h>
namespace slobrok::api {
namespace {
constexpr size_t num_warn_intervals = 5;
-const double warn_intervals[num_warn_intervals] = { 0.0, 10.0, 60.0, 600.0, 3600.0 };
+const double warn_intervals[num_warn_intervals] = { 1.0, 10.0, 60.0, 600.0, 3600.0 };
}
BackOff::BackOff() { reset(); }
@@ -26,6 +27,9 @@ double BackOff::get() {
}
bool BackOff::shouldWarn() {
+ if (vespalib::SignalHandler::TERM.check()) {
+ return false;
+ }
if (_since_last_warn >= warn_intervals[_nextwarn_idx]) {
if (_nextwarn_idx + 1 < num_warn_intervals) {
++_nextwarn_idx;
