n8n/packages/cli/test/unit
Iván Ovejero f53c482939
perf(core): Improve caching service (#8213)
Story: https://linear.app/n8n/issue/PAY-1188

- Implement Redis hashes on the caching service, based on Micha's work
in #7747, adapted from `node-cache-manager-ioredis-yet`. Optimize
workflow ownership lookups and manual webhook lookups with Redis hashes.
- Simplify the caching service by removing all currently unused methods
and options: `enable`, `disable`, `getCache`, `keys`, `keyValues`,
`refreshFunctionEach`, `refreshFunctionMany`, `refreshTtl`, etc.
- Remove the flag `N8N_CACHE_ENABLED`. Currently some features on
`master` are broken with caching disabled, and test webhooks now rely
entirely on caching, for multi-main setup support. We originally
introduced this flag to protect against excessive memory usage, but
total cache usage is low enough that we decided to drop this setting.
Apparently this flag was also never documented.
- Overall caching service refactor: use generics, reduce branching, add
discriminants for cache kinds for better type safety, type caching
events, improve readability, remove outdated docs, etc. Also refactor
and expand caching service tests.

Follow-up to: https://github.com/n8n-io/n8n/pull/8176

---------

Co-authored-by: Michael Auerswald <michael.auerswald@gmail.com>
2024-01-05 11:52:44 +01:00
..
collaboration refactor(core): Continue moving typeorm operators to repositories (no-changelog) (#8186) 2024-01-02 17:53:24 +01:00
controllers refactor(core): Continue moving typeorm operators to repositories (no-changelog) (#8186) 2024-01-02 17:53:24 +01:00
databases/utils fix(editor): Validate user info before submiting (#7608) 2023-11-22 12:14:44 +01:00
decorators feat(core): Unify application components shutdown (#8097) 2023-12-22 12:39:58 +02:00
execution-lifecyle fix: Stop binary data restoration from preventing execution from finishing (#8082) 2023-12-21 09:40:39 +00:00
ExternalSecrets ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
license refactor(core): Move license endpoints to a decorated controller class (no-changelog) (#8074) 2023-12-19 12:13:19 +01:00
middleware refactor(core): Make Logger a service (no-changelog) (#7494) 2023-10-25 16:35:22 +02:00
push ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
repositories refactor(core): Move typeorm operators from WaitTracker to ExecutionRepository (no-changelog) (#8163) 2023-12-28 19:22:09 +01:00
services perf(core): Improve caching service (#8213) 2024-01-05 11:52:44 +01:00
shared fix(core): Prevent workflow history saving error from happening (#7812) 2023-12-13 11:41:06 +00:00
shutdown feat(core): Unify application components shutdown (#8097) 2023-12-22 12:39:58 +02:00
utilities refactor(core): Introduce password utility (no-changelog) (#7979) 2023-12-11 18:23:42 +01:00
ActiveExecutions.test.ts refactor(core): Don't use DB transactions on ExecutionRepository.createNewExecution (#8002) 2023-12-12 14:36:56 +01:00
CredentialsHelper.test.ts refactor(core): Delete unused code, and fix typings in tests (no-changelog) (#8142) 2023-12-22 15:41:29 +01:00
CredentialTypes.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
CurlConverterHelper.test.ts ci: Expand ESLint to tests in BE packages (no-changelog) (#6147) 2023-05-02 10:37:19 +02:00
Helpers.ts ci: Expand ESLint to tests in BE packages (no-changelog) (#6147) 2023-05-02 10:37:19 +02:00
InternalHooks.test.ts refactor(core): Delete unused code, and fix typings in tests (no-changelog) (#8142) 2023-12-22 15:41:29 +01:00
License.test.ts refactor(core): Move license endpoints to a decorated controller class (no-changelog) (#8074) 2023-12-19 12:13:19 +01:00
PermissionChecker.test.ts test(core): Improve tests for subworkflow caller policy checks (no-changelog) (#7954) 2023-12-08 11:21:43 +01:00
PostHog.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
SourceControl.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
Telemetry.test.ts refactor(core): Delete unused code, and fix typings in tests (no-changelog) (#8142) 2023-12-22 15:41:29 +01:00
TestWebhooks.test.ts feat(core): Cache test webhook registrations (#8176) 2024-01-03 16:58:33 +01:00
UserManagementMailer.test.ts fix(core): Do not return inviteAcceptUrl in response if email was sent (#7465) 2023-10-19 13:58:06 +02:00
utils.test.ts refactor(core): Improve test-webhooks (no-changelog) (#8069) 2023-12-19 17:32:02 +01:00
WebhookHelpers.test.ts feat(core): Add Support for custom CORS origins for webhooks (#7455) 2023-11-22 17:49:56 +01:00
webhooks.test.ts refactor(core): Extract ActiveWebhooks out of ActiveWorkflowRunner (no-changelog) (#8171) 2023-12-28 10:04:32 +01:00
WorkflowExecuteAdditionalData.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
WorkflowHelpers.test.ts fix(core): Prevent workflow history saving error from happening (#7812) 2023-12-13 11:41:06 +00:00
workflowHistoryHelper.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
WorkflowRunner.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00