Remove performance logs (#6709)

We have found the root cause of the issue:
- when using a datasource (including the cached ones), we are fetching
ObjectMetadataCollection from cache (700kB). Datasource usage is
happening any time we are using twentyORM, which is everywhere in the
jobs and in some resolvers (including the GetCurrentUser one). This is
leading to a high load on redis and leading to the performance issues we
are seeing.
- we actually don't need to fetch this objectMetadataCollection while
using a cached datasource, only when we instantiate a new one
This commit is contained in:
Charles Bochet
2024-08-21 14:17:11 +02:00
committed by GitHub
parent aa4ae53fb4
commit 612a875c7b
5 changed files with 25 additions and 68 deletions

View File

@ -16,7 +16,6 @@ export class CacheManager<T> {
return this.cache.get(cacheKey)!;
}
// Remove old entries with the same workspaceId
for (const key of this.cache.keys()) {
if (key.startsWith(`${workspaceId}-`)) {
await onDelete?.(this.cache.get(key)!);
@ -24,7 +23,6 @@ export class CacheManager<T> {
}
}
// Create a new value using the factory callback
const value = await factory();
if (!value) {