Add pause until, store as unix second, to disable a user for a time

This commit is contained in:
Bel LaPointe
2022-01-11 23:11:42 -05:00
parent 9840be93f6
commit 4ffc6bba8c
5 changed files with 59 additions and 2 deletions

View File

@@ -14,6 +14,9 @@ type Duration struct {
}
func (d Duration) Get() time.Duration {
if d.least == 0 {
d.least = time.Second
}
jitter := d.most - d.least
if jitter >= time.Second {
jitter = time.Second * time.Duration(rand.Int()%int(jitter.Seconds()))