The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Ensure one export per file for constants of trash-cleanup. (#15110)
Abdullah.6c035ede8ae7
diff --git a/packages/twenty-server/src/engine/trash-cleanup/commands/trash-cleanup.cron.command.ts b/packages/twenty-server/src/engine/trash-cleanup/commands/trash-cleanup.cron.command.tsindex ced36075ef4..f3b42a98f4e 100644--- a/packages/twenty-server/src/engine/trash-cleanup/commands/trash-cleanup.cron.command.ts+++ b/packages/twenty-server/src/engine/trash-cleanup/commands/trash-cleanup.cron.command.ts@@ -3,7 +3,7 @@ import { Command, CommandRunner } from 'nest-commander';import { InjectMessageQueue } from 'src/engine/core-modules/message-queue/decorators/message-queue.decorator';import { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';-import { TRASH_CLEANUP_CRON_PATTERN } from 'src/engine/trash-cleanup/constants/trash-cleanup.constants';+import { TRASH_CLEANUP_CRON_PATTERN } from 'src/engine/trash-cleanup/constants/trash-cleanup-cron-pattern.constant';import { TrashCleanupCronJob } from 'src/engine/trash-cleanup/crons/trash-cleanup.cron.job';@Command({diff --git a/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-batch-size.constant.ts b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-batch-size.constant.tsnew file mode 100644index 00000000000..f4116463d33--- /dev/null+++ b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-batch-size.constant.ts@@ -0,0 +1 @@+export const TRASH_CLEANUP_BATCH_SIZE = 1_000;diff --git a/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-cron-pattern.constant.ts b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-cron-pattern.constant.tsnew file mode 100644index 00000000000..36d94e6785f--- /dev/null+++ b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-cron-pattern.constant.ts@@ -0,0 +1 @@+export const TRASH_CLEANUP_CRON_PATTERN = '10 0 * * *';diff --git a/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-max-records-per-workspace.constant.ts b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-max-records-per-workspace.constant.tsnew file mode 100644index 00000000000..d1008fe8a93--- /dev/null+++ b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup-max-records-per-workspace.constant.ts@@ -0,0 +1 @@+export const TRASH_CLEANUP_MAX_RECORDS_PER_WORKSPACE = 1_000_000;diff --git a/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup.constants.ts b/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup.constants.tsdeleted file mode 100644index ba74a0839db..00000000000--- a/packages/twenty-server/src/engine/trash-cleanup/constants/trash-cleanup.constants.ts+++ /dev/null@@ -1,5 +0,0 @@-// Daily at 00:10 UTC-export const TRASH_CLEANUP_CRON_PATTERN = '10 0 * * *';--export const TRASH_CLEANUP_MAX_RECORDS_PER_WORKSPACE = 1_000_000;-export const TRASH_CLEANUP_BATCH_SIZE = 1_000;diff --git a/packages/twenty-server/src/engine/trash-cleanup/crons/trash-cleanup.cron.job.ts b/packages/twenty-server/src/engine/trash-cleanup/crons/trash-cleanup.cron.job.tsindex 41c67bd7f24..0a840f41532 100644--- a/packages/twenty-server/src/engine/trash-cleanup/crons/trash-cleanup.cron.job.ts+++ b/packages/twenty-server/src/engine/trash-cleanup/crons/trash-cleanup.cron.job.ts@@ -12,7 +12,7 @@ import { Processor } from 'src/engine/core-modules/message-queue/decorators/procimport { MessageQueue } from 'src/engine/core-modules/message-queue/message-queue.constants';import { MessageQueueService } from 'src/engine/core-modules/message-queue/services/message-queue.service';import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity';-import { TRASH_CLEANUP_CRON_PATTERN } from 'src/engine/trash-cleanup/constants/trash-cleanup.constants';+import { TRASH_CLEANUP_CRON_PATTERN } from 'src/engine/trash-cleanup/constants/trash-cleanup-cron-pattern.constant';import {TrashCleanupJob,type TrashCleanupJobData,diff --git a/packages/twenty-server/src/engine/trash-cleanup/services/trash-cleanup.service.ts b/packages/twenty-server/src/engine/trash-cleanup/services/trash-cleanup.service.tsindex 1d044f75f7b..1728d0e2998 100644--- a/packages/twenty-server/src/engine/trash-cleanup/services/trash-cleanup.service.ts+++ b/packages/twenty-server/src/engine/trash-cleanup/services/trash-cleanup.service.ts@@ -4,10 +4,8 @@ import { isDefined } from 'twenty-shared/utils';import { In, LessThan } from 'typeorm';import { WorkspaceManyOrAllFlatEntityMapsCacheService } from 'src/engine/metadata-modules/flat-entity/services/workspace-many-or-all-flat-entity-maps-cache.service';-import {- TRASH_CLEANUP_BATCH_SIZE,- TRASH_CLEANUP_MAX_RECORDS_PER_WORKSPACE,-} from 'src/engine/trash-cleanup/constants/trash-cleanup.constants';+import { TRASH_CLEANUP_BATCH_SIZE } from 'src/engine/trash-cleanup/constants/trash-cleanup-batch-size.constant';+import { TRASH_CLEANUP_MAX_RECORDS_PER_WORKSPACE } from 'src/engine/trash-cleanup/constants/trash-cleanup-max-records-per-workspace.constant';import { TwentyORMGlobalManager } from 'src/engine/twenty-orm/twenty-orm-global.manager';export type TrashCleanupInput = {