Skip to content

Commit 8797876

Browse files
chore(): add env variable for max batch size (#550)
* chore(): add env variable for max batch size * Bump version up to 1.2.2 --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent bc7bf78 commit 8797876

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

.env.sample

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ JWT_SECRET_REFRESH_TOKEN=abacaba
2020
# JWT secret for user's access token
2121
JWT_SECRET_ACCESS_TOKEN=belarus
2222

23+
# max document could for one read request to the database
24+
MAX_DB_READ_BATCH_SIZE=100000
2325

2426
# JWT secret for signing tokens for processing billing requests
2527
JWT_SECRET_BILLING_CHECKSUM=checksum_secret

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hawk.api",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"main": "index.ts",
55
"license": "BUSL-1.1",
66
"scripts": {

src/models/eventsFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const Event = require('../models/event');
77
const { ObjectID } = require('mongodb');
88
const { composeEventPayloadByRepetition } = require('../utils/merge');
99

10-
const MAX_DB_READ_BATCH_SIZE = 80000;
10+
const MAX_DB_READ_BATCH_SIZE = process.env.MAX_DB_READ_BATCH_SIZE;
1111

1212
/**
1313
* @typedef {import('mongodb').UpdateWriteOpResult} UpdateWriteOpResult

0 commit comments

Comments
 (0)