bullmq 1.86.0 → 1.86.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,9 @@
1
1
  --[[
2
2
  Functions to collect metrics based on a current and previous count of jobs.
3
3
  Granualarity is fixed at 1 minute.
4
- ]] local function collectMetrics(metaKey, dataPointsList, maxDataPoints,
4
+ ]]
5
+ --- @include "batches"
6
+ local function collectMetrics(metaKey, dataPointsList, maxDataPoints,
5
7
  timestamp)
6
8
  -- Increment current count
7
9
  local count = rcall("HINCRBY", metaKey, "count", 1) - 1
@@ -26,7 +28,10 @@
26
28
  for i = 2, N do
27
29
  points[i] = 0
28
30
  end
29
- rcall("LPUSH", dataPointsList, unpack(points))
31
+
32
+ for from, to in batches(#points, 7000) do
33
+ rcall("LPUSH", dataPointsList, unpack(points, from, to))
34
+ end
30
35
  else
31
36
  -- LPUSH delta to the list
32
37
  rcall("LPUSH", dataPointsList, delta)
@@ -1,7 +1,9 @@
1
1
  --[[
2
2
  Functions to collect metrics based on a current and previous count of jobs.
3
3
  Granualarity is fixed at 1 minute.
4
- ]] local function collectMetrics(metaKey, dataPointsList, maxDataPoints,
4
+ ]]
5
+ --- @include "batches"
6
+ local function collectMetrics(metaKey, dataPointsList, maxDataPoints,
5
7
  timestamp)
6
8
  -- Increment current count
7
9
  local count = rcall("HINCRBY", metaKey, "count", 1) - 1
@@ -26,7 +28,10 @@
26
28
  for i = 2, N do
27
29
  points[i] = 0
28
30
  end
29
- rcall("LPUSH", dataPointsList, unpack(points))
31
+
32
+ for from, to in batches(#points, 7000) do
33
+ rcall("LPUSH", dataPointsList, unpack(points, from, to))
34
+ end
30
35
  else
31
36
  -- LPUSH delta to the list
32
37
  rcall("LPUSH", dataPointsList, delta)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bullmq",
3
- "version": "1.86.0",
3
+ "version": "1.86.1",
4
4
  "description": "Queue for messages and jobs based on Redis",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",