mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-09-28 20:43:54 +02:00
Remove monitoring.StartQueueSegment from workers.Aquire
This commit is contained in:
@@ -3,7 +3,6 @@ package workers
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"github.com/imgproxy/imgproxy/v3/monitoring"
|
|
||||||
"golang.org/x/sync/semaphore"
|
"golang.org/x/sync/semaphore"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -42,8 +41,6 @@ func New(config *Config) (*Workers, error) {
|
|||||||
// Acquire acquires a worker.
|
// Acquire acquires a worker.
|
||||||
// It returns a worker release function and an error if any.
|
// It returns a worker release function and an error if any.
|
||||||
func (s *Workers) Acquire(ctx context.Context) (context.CancelFunc, error) {
|
func (s *Workers) Acquire(ctx context.Context) (context.CancelFunc, error) {
|
||||||
defer monitoring.StartQueueSegment(ctx)()
|
|
||||||
|
|
||||||
// First, try to acquire the queue semaphore if configured.
|
// First, try to acquire the queue semaphore if configured.
|
||||||
// If the queue is full, return an error immediately.
|
// If the queue is full, return an error immediately.
|
||||||
releaseQueue, err := s.acquireQueue()
|
releaseQueue, err := s.acquireQueue()
|
||||||
|
Reference in New Issue
Block a user