Provide a wrapper to execute command on workspace with easier devXP (#10391)
Proposal: - Add a method in ActiveWorkspaceCommand to loop over workspace safely (add counter, add try / catch, provide datasource with fresh cache, destroy datasource => as we do always do it) Also in this PR: - make sure we clear all dataSources (and not only the one on metadata version in RAM)
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import { isDefined } from 'twenty-shared';
|
||||
|
||||
type CacheKey = `${string}-${string}`;
|
||||
import { CacheKey } from 'src/engine/twenty-orm/storage/types/cache-key.type';
|
||||
|
||||
type AsyncFactoryCallback<T> = () => Promise<T | null>;
|
||||
|
||||
@ -52,6 +52,9 @@ export class CacheManager<T> {
|
||||
await onDelete?.(cachedValue);
|
||||
this.cache.delete(cacheKey);
|
||||
}
|
||||
// TODO: remove this once we have debug on prod
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Datasource cache size: ', this.cache.size);
|
||||
}
|
||||
|
||||
async clear(onDelete?: (value: T) => Promise<void> | void): Promise<void> {
|
||||
|
||||
@ -0,0 +1 @@
|
||||
export type CacheKey = `${string}-${string}`;
|
||||
Reference in New Issue
Block a user