mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[bugfix] update go-cache library to fix critical bug during cache sweep scheduling (#725)
* update go-cache library to fix critical bug regarding cache sweep scheduling Signed-off-by: kim <grufwub@gmail.com> * update go-sched Signed-off-by: kim <grufwub@gmail.com>
This commit is contained in:
19
vendor/codeberg.org/gruf/go-sched/job.go
generated
vendored
19
vendor/codeberg.org/gruf/go-sched/job.go
generated
vendored
@@ -1,6 +1,9 @@
|
||||
package sched
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"codeberg.org/gruf/go-atomics"
|
||||
@@ -97,3 +100,19 @@ func (job *Job) Run(now time.Time) {
|
||||
}()
|
||||
job.call(now)
|
||||
}
|
||||
|
||||
// String provides a debuggable string representation of Job including ID, next time and Timing type.
|
||||
func (job *Job) String() string {
|
||||
var buf strings.Builder
|
||||
buf.WriteByte('{')
|
||||
buf.WriteString("id=")
|
||||
buf.WriteString(strconv.FormatUint(job.id, 10))
|
||||
buf.WriteByte(' ')
|
||||
buf.WriteString("next=")
|
||||
buf.WriteString(job.next.Load().Format(time.StampMicro))
|
||||
buf.WriteByte(' ')
|
||||
buf.WriteString("timing=")
|
||||
buf.WriteString(reflect.TypeOf(job.timing).String())
|
||||
buf.WriteByte('}')
|
||||
return buf.String()
|
||||
}
|
||||
|
Reference in New Issue
Block a user