mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore]: Bump codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0 (#2902)
Bumps codeberg.org/gruf/go-structr from 0.7.0 to 0.8.0. --- updated-dependencies: - dependency-name: codeberg.org/gruf/go-structr dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
18
vendor/codeberg.org/gruf/go-structr/queue_ctx.go
generated
vendored
18
vendor/codeberg.org/gruf/go-structr/queue_ctx.go
generated
vendored
@ -64,6 +64,24 @@ func (q *QueueCtx[T]) Wait() <-chan struct{} {
|
||||
return ctx
|
||||
}
|
||||
|
||||
// Debug returns debug stats about queue.
|
||||
func (q *QueueCtx[T]) Debug() map[string]any {
|
||||
m := make(map[string]any)
|
||||
q.mutex.Lock()
|
||||
m["queue"] = q.queue.len
|
||||
indices := make(map[string]any)
|
||||
m["indices"] = indices
|
||||
for i := range q.indices {
|
||||
var n uint64
|
||||
for _, list := range q.indices[i].data {
|
||||
n += uint64(list.len)
|
||||
}
|
||||
indices[q.indices[i].name] = n
|
||||
}
|
||||
q.mutex.Unlock()
|
||||
return m
|
||||
}
|
||||
|
||||
func (q *QueueCtx[T]) pop(ctx context.Context, next func() *list_elem) (T, bool) {
|
||||
if next == nil {
|
||||
panic("nil fn")
|
||||
|
Reference in New Issue
Block a user