diff --git a/.env.sample b/.env.sample index 2f8fdd74..efbdd12e 100644 --- a/.env.sample +++ b/.env.sample @@ -20,6 +20,8 @@ JWT_SECRET_REFRESH_TOKEN=abacaba # JWT secret for user's access token JWT_SECRET_ACCESS_TOKEN=belarus +# max document could for one read request to the database +MAX_DB_READ_BATCH_SIZE=100000 # JWT secret for signing tokens for processing billing requests JWT_SECRET_BILLING_CHECKSUM=checksum_secret diff --git a/package.json b/package.json index 8ab87869..2a6f2a42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hawk.api", - "version": "1.2.1", + "version": "1.2.2", "main": "index.ts", "license": "BUSL-1.1", "scripts": { diff --git a/src/models/eventsFactory.js b/src/models/eventsFactory.js index d294043b..d341366c 100644 --- a/src/models/eventsFactory.js +++ b/src/models/eventsFactory.js @@ -7,7 +7,7 @@ const Event = require('../models/event'); const { ObjectID } = require('mongodb'); const { composeEventPayloadByRepetition } = require('../utils/merge'); -const MAX_DB_READ_BATCH_SIZE = 80000; +const MAX_DB_READ_BATCH_SIZE = process.env.MAX_DB_READ_BATCH_SIZE; /** * @typedef {import('mongodb').UpdateWriteOpResult} UpdateWriteOpResult