mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-07-26 16:25:26 +02:00
fix(settings): update readMonitoringConfig to async and improve log reading efficiency
This commit is contained in:
@@ -609,14 +609,14 @@ export const settingsRouter = createTRPCRouter({
|
||||
},
|
||||
})
|
||||
.input(apiReadStatsLogs)
|
||||
.query(({ input }) => {
|
||||
.query(async ({ input }) => {
|
||||
if (IS_CLOUD) {
|
||||
return {
|
||||
data: [],
|
||||
totalCount: 0,
|
||||
};
|
||||
}
|
||||
const rawConfig = readMonitoringConfig(
|
||||
const rawConfig = await readMonitoringConfig(
|
||||
!!input.dateRange?.start && !!input.dateRange?.end,
|
||||
);
|
||||
|
||||
@@ -652,11 +652,11 @@ export const settingsRouter = createTRPCRouter({
|
||||
})
|
||||
.optional(),
|
||||
)
|
||||
.query(({ input }) => {
|
||||
.query(async ({ input }) => {
|
||||
if (IS_CLOUD) {
|
||||
return [];
|
||||
}
|
||||
const rawConfig = readMonitoringConfig(
|
||||
const rawConfig = await readMonitoringConfig(
|
||||
!!input?.dateRange?.start || !!input?.dateRange?.end,
|
||||
);
|
||||
const processedLogs = processLogs(rawConfig as string, input?.dateRange);
|
||||
|
||||
Reference in New Issue
Block a user