mirror of
https://git.vectorsigma.ru/public/photoview.git
synced 2026-08-03 20:59:03 +00:00
Reintregrate notifications with scanner
This commit is contained in:
@@ -15,6 +15,9 @@ func NewThrottle(interval time.Duration) Throttle {
|
||||
}
|
||||
|
||||
func (t *Throttle) Trigger(action func()) {
|
||||
if action == nil {
|
||||
return
|
||||
}
|
||||
if time.Now().After(t.lastAction.Add(t.interval)) {
|
||||
t.lastAction = time.Now()
|
||||
action()
|
||||
|
||||
Reference in New Issue
Block a user