998 workflow restore (#12417)

Add a post hook to restore workflow sub-entities
This commit is contained in:
martmull
2025-06-03 15:28:43 +02:00
committed by GitHub
parent a943f9cf36
commit cb010d90fe
27 changed files with 600 additions and 173 deletions

View File

@ -1,6 +1,8 @@
import { Milliseconds } from 'cache-manager';
import { isDefined } from 'twenty-shared/utils';
import { NodeEnvironment } from 'src/engine/core-modules/twenty-config/interfaces/node-environment.interface';
import { CacheKey } from 'src/engine/twenty-orm/storage/types/cache-key.type';
type AsyncFactoryCallback<T> = () => Promise<T | null>;
@ -37,10 +39,12 @@ export class PromiseMemoizer<T> {
return existingPromise;
}
// eslint-disable-next-line no-console
console.log(
`Computing new Datasource for cacheKey: ${cacheKey} out of ${this.cache.size}`,
);
if (process.env.NODE_ENV !== NodeEnvironment.TEST) {
// eslint-disable-next-line no-console
console.log(
`Computing new Datasource for cacheKey: ${cacheKey} out of ${this.cache.size}`,
);
}
const newPromise = (async () => {
try {