n8n/packages/cli/test/unit/services
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
..
activeWorkflows.service.test.ts refactor(core): Move active workflows endpoints to a decorated controller class (no-changelog) (#8101) 2023-12-22 11:28:42 +01:00
cache-mock.service.test.ts perf(core): Improve caching service (#8213) 2024-01-05 11:52:44 +01:00
cache.service.test.ts perf(core): Improve caching service (#8213) 2024-01-05 11:52:44 +01:00
communityPackages.service.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
events.service.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
jwt.service.test.ts fix(core): Initialize JWT Secret before it's used anywhere (#7707) 2023-11-15 12:17:18 +01:00
naming.service.test.ts refactor(core): Move more typeorm operators to repositories (no-changelog) (#8143) 2023-12-22 16:20:30 +01:00
orchestration.service.test.ts feat(core): Coordinate manual workflow activation and deactivation in multi-main scenario (#7643) 2023-11-17 15:58:50 +01:00
ownership.service.test.ts fix(core): Prevent workflow history saving error from happening (#7812) 2023-12-13 11:41:06 +00:00
redis.service.test.ts ci(core): Reduce memory usage in tests (part-2) (no-changelog) (#7671) 2023-11-10 15:04:26 +01:00
role.service.test.ts perf(core): Improve caching service (#8213) 2024-01-05 11:52:44 +01:00
test-webhook-registrations.service.test.ts perf(core): Improve caching service (#8213) 2024-01-05 11:52:44 +01:00
user.service.test.ts fix(core): Ensure inviter and invitee are set correctly in invite link (#7943) 2023-12-07 10:53:31 +01:00
webhook.service.test.ts perf(core): Improve caching service (#8213) 2024-01-05 11:52:44 +01:00
workflowHistory.service.ee.test.ts fix(core): Prevent workflow history saving error from happening (#7812) 2023-12-13 11:41:06 +00:00