mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 02:21:13 +00:00
feat: Enforce data-stores limits (no-changelog) (#19116)
Co-authored-by: Charlie Kolb <charlie@n8n.io>
This commit is contained in:
22
packages/@n8n/config/src/configs/data-table.config.ts
Normal file
22
packages/@n8n/config/src/configs/data-table.config.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { Config, Env } from '../decorators';
|
||||
|
||||
@Config
|
||||
export class DataTableConfig {
|
||||
/** Specifies the maximum allowed size (in bytes) for data tables. */
|
||||
@Env('N8N_DATA_TABLES_MAX_SIZE_BYTES')
|
||||
maxSize: number = 100 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* The percentage threshold at which a warning is triggered for data tables.
|
||||
* When the usage of a data table reaches or exceeds this value, a warning is issued.
|
||||
*/
|
||||
@Env('N8N_DATA_TABLES_WARNING_THRESHOLD_BYTES')
|
||||
warningThreshold: number = 95 * 1024 * 1024;
|
||||
|
||||
/**
|
||||
* The duration in milliseconds for which the data table size is cached.
|
||||
* This prevents excessive database queries for size validation.
|
||||
*/
|
||||
@Env('N8N_DATA_TABLES_SIZE_CHECK_CACHE_DURATION_MS')
|
||||
sizeCheckCacheDuration: number = 5 * 1000;
|
||||
}
|
||||
Reference in New Issue
Block a user