1
0
Fork 0
forked from forgejo/forgejo

Queue: Add monitoring

This commit is contained in:
Andrew Thornton 2019-12-07 16:48:21 +00:00
parent 85d1a7f7d2
commit 2927bc6fe5
No known key found for this signature in database
GPG key ID: 3CDE74631F13A748
13 changed files with 541 additions and 20 deletions

View file

@ -111,7 +111,7 @@ func NewWrappedQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, erro
return nil, ErrInvalidConfiguration{cfg: cfg}
}
return &WrappedQueue{
queue = &WrappedQueue{
handle: handle,
channel: make(chan Data, config.QueueLength),
exemplar: exemplar,
@ -122,7 +122,14 @@ func NewWrappedQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, erro
maxAttempts: config.MaxAttempts,
name: config.Name,
},
}, nil
}
_ = GetManager().Add(queue, WrappedQueueType, config, exemplar, nil, nil)
return queue, nil
}
// Name returns the name of the queue
func (q *WrappedQueue) Name() string {
return q.name + "-wrapper"
}
// Push will push the data to the internal channel checking it against the exemplar