mirror of
https://github.com/hibiken/asynq.git
synced 2026-08-11 03:22:30 +08:00
Merge pull request #1127 from grnhse/disable-mem-usage
Try disabling memory usage profiling
This commit is contained in:
@@ -7,6 +7,7 @@ package rdb
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -228,11 +229,15 @@ func (r *RDB) CurrentStats(qname string) (*Stats, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
stats.Size = size
|
stats.Size = size
|
||||||
|
disableMemUsageProfiling := os.Getenv("DISABLE_MEMORY_USAGE_PROFILING")
|
||||||
|
if disableMemUsageProfiling == "false" || disableMemUsageProfiling == "" {
|
||||||
memusg, err := r.memoryUsage(qname)
|
memusg, err := r.memoryUsage(qname)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.E(op, errors.CanonicalCode(err), err)
|
return nil, errors.E(op, errors.CanonicalCode(err), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.MemoryUsage = memusg
|
stats.MemoryUsage = memusg
|
||||||
|
}
|
||||||
return stats, nil
|
return stats, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user