Optimize sync, reset, seed commands to flush cache and to use less memory (#7034)
In this PR: - removing ugprade-0.24 commands as we are releasing 0.30 - introducing cache:flush command - refactoring upgrade command and sync-metadata command to use the ActiveWorkspacesCommand so they consistently run on all workspaces or selected workspaces Fixes: - clear localStorage on sign out - fix missing workspaceMember in verify resolver - do not throw on datasource already destroyed exception which can happen with race condition when several resolvers are resolving in parallel
This commit is contained in:
@ -146,7 +146,18 @@ export class WorkspaceDatasourceFactory {
|
||||
|
||||
return workspaceDataSource;
|
||||
},
|
||||
(dataSource) => dataSource.destroy(),
|
||||
async (dataSource) => {
|
||||
try {
|
||||
await dataSource.destroy();
|
||||
} catch (error) {
|
||||
// Ignore error if pool has already been destroyed which is a common race condition case
|
||||
if (error.message === 'Called end on pool more than once') {
|
||||
return;
|
||||
}
|
||||
|
||||
throw error;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
if (!workspaceDataSource) {
|
||||
|
||||
Reference in New Issue
Block a user