feat: integrate RedisNode management into Project and Query services; enhance RedisNodeService with optimal node selection and connection options; update vm.constants to include RedisPlugin

This commit is contained in:
lborv
2025-10-09 19:54:08 +03:00
parent c3189bb2df
commit 174dbbcdba
9 changed files with 97 additions and 12 deletions

View File

@ -27,11 +27,9 @@ export class DatabaseNodeService extends DatabaseEncryptionService {
return null;
}
return nodes.reduce((optimalNode, currentNode) => {
const currentCount = currentNode.databases?.length || 0;
const optimalCount = optimalNode.databases?.length || 0;
return currentCount < optimalCount ? currentNode : optimalNode;
});
nodes.sort((a, b) => a.databases.length - b.databases.length);
return nodes[0];
}
async initDatabase(