Skip to content

Commit 2fc61bf

Browse files
committed
⚡ Add high water to bottleneck to improve memory usage
1 parent f68fb26 commit 2fc61bf

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

‎.env.example‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ WEBHOOK_SECRET=development
44
PRIVATE_KEY=
55
PULL_INTERVAL=3600
66
MAX_CONCURRENT=10
7+
MAX_IN_QUEUE=1000
78
CONFIG_FILENAME=pull.yml
89
DISABLE_DELAY=
910
DISABLE_STATS=

‎index.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ module.exports = async (app) => {
1111

1212
app.limiter = new Bottleneck({
1313
maxConcurrent: parseInt(process.env.MAX_CONCURRENT, 10) || 10,
14+
highWater: parseInt(process.env.MAX_IN_QUEUE, 10) || 1000,
15+
strategy: Bottleneck.strategy.OVERFLOW,
1416
trackDoneStatus: false
1517
})
1618

0 commit comments

Comments
 (0)