This commit is contained in:
commit
bd774932d5
614 files changed
+77116
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package alertcontrol
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
)
|
||||
|
||||
type ExpiryJob struct {
|
||||
Store Store
|
||||
Now func() time.Time
|
||||
}
|
||||
|
||||
func (job ExpiryJob) Run(ctx context.Context) (ExpiryResult, error) {
|
||||
if job.Now == nil {
|
||||
job.Now = time.Now
|
||||
}
|
||||
return job.Store.Expire(ctx, job.Now().UTC())
|
||||
}
|
||||
Reference in new issue
Block a user