Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

skip limiting if limit is zero

Chris Lufbb82a5c9c3e
diff --git a/weed/util/limiter.go b/weed/util/limiter.go
index ccdaa701e1..2debaaa855 100644
--- a/weed/util/limiter.go
+++ b/weed/util/limiter.go
@@ -85,16 +85,20 @@ func NewLimitedOutOfOrderProcessor(limit int32) (c *LimitedOutOfOrderProcessor)
request := value.Interface().(OperationRequest)
- c.processorLimitCond.L.Lock()
- for atomic.LoadInt32(&c.currentProcessor) > c.processorLimit {
- c.processorLimitCond.Wait()
+ if c.processorLimit > 0 {
+ c.processorLimitCond.L.Lock()
+ for atomic.LoadInt32(&c.currentProcessor) > c.processorLimit {
+ c.processorLimitCond.Wait()
+ }
+ atomic.AddInt32(&c.currentProcessor, 1)
+ c.processorLimitCond.L.Unlock()
}
- atomic.AddInt32(&c.currentProcessor, 1)
- c.processorLimitCond.L.Unlock()
go func() {
- defer atomic.AddInt32(&c.currentProcessor, -1)
- defer c.processorLimitCond.Signal()
+ if c.processorLimit > 0 {
+ defer atomic.AddInt32(&c.currentProcessor, -1)
+ defer c.processorLimitCond.Signal()
+ }
request()
}()