mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-11-01 21:22:24 -05:00
[chore] pull in latest go-cache, go-runners versions (#1306)
Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
parent
0dbe6c514f
commit
adbc87700a
23 changed files with 329 additions and 865 deletions
8
vendor/codeberg.org/gruf/go-cache/v3/ttl/schedule.go
generated
vendored
8
vendor/codeberg.org/gruf/go-cache/v3/ttl/schedule.go
generated
vendored
|
|
@ -6,15 +6,15 @@ import (
|
|||
"codeberg.org/gruf/go-sched"
|
||||
)
|
||||
|
||||
// scheduler is the global cache runtime scheduler
|
||||
// for handling regular cache evictions.
|
||||
// scheduler is the global cache runtime
|
||||
// scheduler for handling cache evictions.
|
||||
var scheduler sched.Scheduler
|
||||
|
||||
// schedule will given sweep routine to the global scheduler, and start global scheduler.
|
||||
func schedule(sweep func(time.Time), freq time.Duration) func() {
|
||||
if !scheduler.Running() {
|
||||
// ensure running
|
||||
_ = scheduler.Start()
|
||||
// ensure sched running
|
||||
_ = scheduler.Start(nil)
|
||||
}
|
||||
return scheduler.Schedule(sched.NewJob(sweep).Every(freq))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue