mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-05 14:05:30 +02:00
refactor: streamline event fetching and improve UI table layout
Updated the event fetching logic to utilize Promise.all for concurrent API calls, enhancing performance. Adjusted the UI table layout by modifying the column span for better alignment and presentation of the empty queue state. Introduced constants for maximum events to improve code clarity.
This commit is contained in:
@@ -96,11 +96,10 @@ export const deploymentRouter = createTRPCRouter({
|
||||
where: eq(server.organizationId, orgId),
|
||||
columns: { serverId: true },
|
||||
});
|
||||
rows = [];
|
||||
for (const { serverId } of servers) {
|
||||
const serverRows = await fetchDeployApiJobs(serverId);
|
||||
rows.push(...serverRows);
|
||||
}
|
||||
const serverRowsArrays = await Promise.all(
|
||||
servers.map(({ serverId }) => fetchDeployApiJobs(serverId)),
|
||||
);
|
||||
rows = serverRowsArrays.flat();
|
||||
rows.sort((a, b) => (b.timestamp ?? 0) - (a.timestamp ?? 0));
|
||||
} else {
|
||||
const jobs = await myQueue.getJobs();
|
||||
|
||||
Reference in New Issue
Block a user