.divorce cooldown now properly works on multiple shards
This commit is contained in:
@ -96,5 +96,18 @@ namespace NadekoBot.Core.Services.Impl
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public bool TryAddDivorceCooldown(ulong userId, out TimeSpan? time)
|
||||
{
|
||||
time = _db.KeyTimeToLive($"{_redisKey}_divorce_{userId}");
|
||||
if (time == null)
|
||||
{
|
||||
time = TimeSpan.FromHours(6);
|
||||
_db.StringSet($"{_redisKey}_divorce_{userId}", true);
|
||||
_db.KeyExpire($"{_redisKey}_divorce_{userId}", time);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user