Introduce ACTION_HISTORY env variables

This commit is contained in:
vviers 2024-10-14 16:47:15 +02:00
parent b1cbc0ed16
commit 4f72f1fbb0

View File

@ -17,9 +17,9 @@ import {ISQLiteDB, ResultRow} from './SQLiteDB';
// on rows and the maximum total number of bytes in the "body" column.
// Pruning is done when the history has grown above these limits, to
// the specified factor.
const ACTION_HISTORY_MAX_ROWS = 1000;
const ACTION_HISTORY_MAX_BYTES = 1000 * 1000 * 1000; // 1 GB.
const ACTION_HISTORY_GRACE_FACTOR = 1.25; // allow growth to 1250 rows / 1.25 GB.
const ACTION_HISTORY_MAX_ROWS = process.env.ACTION_HISTORY_MAX_ROWS || 1000;
const ACTION_HISTORY_MAX_BYTES = process.env.ACTION_HISTORY_MAX_BYTES || 1000 * 1000 * 1000; // 1 GB.
const ACTION_HISTORY_GRACE_FACTOR = 1.25; // allow growth to 1.25 times the above limits.
const ACTION_HISTORY_CHECK_PERIOD = 10; // number of actions between size checks.
/**