Flush cache when reset db (#5214)

Now that we have persistent cache for schemas, we want to be able to
reset its state when users run the database:reset db otherwise schemas
won't be synced with the new DB state.

Note: In an upcoming PR, we want to be able to invalidate the cache on a
workspace level when we change the metadata schema through twenty
version upgrade
This commit is contained in:
Weiko
2024-04-30 15:03:24 +02:00
committed by GitHub
parent f512049381
commit a77cb023c0
2 changed files with 11 additions and 2 deletions

View File

@ -63,6 +63,10 @@ export class CacheStorageService {
});
}
async flush() {
return this.cache.reset();
}
private isRedisCache() {
return (this.cache.store as any)?.name === 'redis';
}