/*
Returns true if the given key in the syncCooldownMap has passed the given cooldown duration, false otherwise
*/
Returns true if the given key in the syncCooldownMap has passed the given cooldown duration, false otherwise
/ * Returns true if the given key in the syncCooldownMap has passed the given cooldown duration false otherwise * /
func isCooldownReached(key string, cooldown time.Duration, cooldownMap *util.SyncCooldownMap) bool {
	cooldownMap.RWMutex.RLock()
	lastTime, present := cooldownMap.M[key]
	cooldownMap.RUnlock()
	if present {
		if lastTime+cooldown.Nanoseconds() > time.Now().UnixNano() {
			return false
		}
	}
	cooldownMap.Lock()
	cooldownMap.M[key] = time.Now().UnixNano()
	cooldownMap.Unlock()
	return true
}
func isCooldownReached ( key string , cooldown time . Duration , cooldownMap * util . SyncCooldownMap ) bool { cooldownMap . RWMutex . RLock ( ) lastTime , present := cooldownMap . M [ key ] cooldownMap . RUnlock ( ) if present { if lastTime + cooldown . Nanoseconds ( ) > time . Now ( ) . UnixNano ( ) { return false } } cooldownMap . Lock ( ) cooldownMap . M [ key ] = time . Now ( ) . UnixNano ( ) cooldownMap . Unlock ( ) return true }
Returns true if the given key in the syncCooldownMap has passed the given cooldown duration, false otherwise
Returns true if the given key in the syncCooldownMap has passed the given cooldown duration false otherwise