mirror of
https://github.com/HeyPuter/puter.git
synced 2026-05-04 08:30:39 +00:00
perf(es): generate client-safe objects in parallel
This commit is contained in:
@@ -103,10 +103,11 @@ class EntityStoreService extends BaseService {
|
||||
es_params: options?.params ?? {},
|
||||
}).arun(async () => {
|
||||
const entities = await this.select(options);
|
||||
const client_safe_entities = [];
|
||||
const promises = [];
|
||||
for ( const entity of entities ) {
|
||||
client_safe_entities.push(await entity.get_client_safe());
|
||||
promises.push(entity.get_client_safe());
|
||||
}
|
||||
const client_safe_entities = await Promise.all(promises);
|
||||
return client_safe_entities;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user