Checkpoint: Ajout du bouton "Vérifier maintenant" pour forcer une vérification immédiate des emails sans attendre le prochain cycle automatique.

This commit is contained in:
Manus
2026-02-11 05:52:56 -05:00
parent fcf9e8f7b7
commit 2715c9e0c7
7 changed files with 139 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ import { loginLocal, hashPassword, getAzureAuthUrl, isAzureAdConfigured, generat
import { extractInvoicesWithMistral, generateMetadataJSON } from "./invoiceExtractor";
import { localStoragePut, generateStorageKey } from "./localStorage";
import { testSftpConnection, exportInvoiceToSftp, getUserSftpConfig } from "./sftpExport";
import { startEmailImportService, stopEmailImportService, isEmailImportServiceRunning } from "./emailImportService";
import { startEmailImportService, stopEmailImportService, isEmailImportServiceRunning, triggerEmailCheck } from "./emailImportService";
import { startFolderImportService, stopFolderImportService, isFolderImportServiceRunning } from "./folderImportService";
import { TRPCError } from "@trpc/server";
@@ -614,8 +614,12 @@ export const appRouter = router({
}),
status: protectedProcedure.query(async ({ ctx }) => {
const isRunning = isEmailImportServiceRunning(ctx.user.id);
return { isRunning };
return { isRunning: isEmailImportServiceRunning(ctx.user.id) };
}),
checkNow: protectedProcedure.mutation(async ({ ctx }) => {
const result = await triggerEmailCheck(ctx.user.id);
return result;
}),
}),