twenty/packages/twenty-server
Weiko db2935b877
[message-queue] Add job auto-removal (#4973)
## Context

With the addition of cronjobs, the app is building a lot of jobs and
stores them indefinitely. There is no real point to keep all of them in
the queue once they have been processed (completed or failed) so we are
adding a new default option to the bull-mq driver

## Implementation
See bull-mq JobsOption doc
```typescript
    /**
     * If true, removes the job when it successfully completes
     * When given a number, it specifies the maximum amount of
     * jobs to keep, or you can provide an object specifying max
     * age and/or count to keep. It overrides whatever setting is used in the worker.
     * Default behavior is to keep the job in the completed set.
     */
    removeOnComplete?: boolean | number | KeepJobs;
    /**
     * If true, removes the job when it fails after all attempts.
     * When given a number, it specifies the maximum amount of
     * jobs to keep, or you can provide an object specifying max
     * age and/or count to keep. It overrides whatever setting is used in the worker.
     * Default behavior is to keep the job in the failed set.
     */
    removeOnFail?: boolean | number | KeepJobs;
```

removeOnFail should be a bit higher since they are the ones we are most
likely looking at when needed.
2024-04-15 17:33:27 +02:00
..
@types Compile with swc on twenty-server (#4863) 2024-04-14 09:09:51 +02:00
patches feat: wip server folder structure (#4573) 2024-03-20 16:23:46 +01:00
scripts Fix environment variable casting (#4855) 2024-04-05 18:15:47 +02:00
src [message-queue] Add job auto-removal (#4973) 2024-04-15 17:33:27 +02:00
test feat: refactor folder structure (#4498) 2024-03-15 14:40:58 +01:00
.env.example fix: sentry init is using the wrong environment (#4940) 2024-04-12 12:27:35 +02:00
.env.test File token chores (#4664) 2024-03-26 13:42:09 +01:00
.eslintrc.js Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.gitignore feat: workspace:health nullable fix (#3882) 2024-02-08 18:22:29 +01:00
.prettierignore Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.prettierrc Migrate to a monorepo structure (#2909) 2023-12-10 18:10:54 +01:00
.swcrc Compile with swc on twenty-server (#4863) 2024-04-14 09:09:51 +02:00
jest.config.ts Refactor backend folder structure (#4505) 2024-03-15 18:37:09 +01:00
nest-cli.json Compile with swc on twenty-server (#4863) 2024-04-14 09:09:51 +02:00
package.json Release 0.4.0 (#4856) 2024-04-05 18:35:48 +02:00
project.json Compile with swc on twenty-server (#4863) 2024-04-14 09:09:51 +02:00
tsconfig.build.json chore: set up twenty-emails config so build isn't needed in development (#3619) 2024-01-29 06:17:12 -03:00
tsconfig.json 4586 fix workspace member feature (#4680) 2024-03-28 17:59:48 +01:00