1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
12 type logger interface {
13 Printf(string, ...interface{})
14 Warnf(string, ...interface{})
15 Debugf(string, ...interface{})
18 var nextSpam = map[string]time.Time{}
19 var nextSpamMtx sync.Mutex
21 func unspam(msg string) bool {
23 defer nextSpamMtx.Unlock()
24 if nextSpam[msg].Before(time.Now()) {
25 nextSpam[msg] = time.Now().Add(time.Minute)