Checkpoint: Ajout du paramétrage de fréquence des mises à jour dans Paramètres → Import & Planification : choix entre mode heure fixe (cron quotidien) et mode intervalle (1h, 2h, 4h, 6h, 12h, 24h). Le cron est rechargé immédiatement après sauvegarde sans redémarrage serveur.
This commit is contained in:
@@ -33,7 +33,7 @@ import {
|
||||
saveRssSettings,
|
||||
} from "./db";
|
||||
import { importVeille, importAAP, runFullImport, getImportConfig } from "./importer";
|
||||
import { scheduleRssFetch } from "./_core/index";
|
||||
import { scheduleDailyImport } from "./_core/index";
|
||||
import { loginLocalUser, hashPassword, ensureAdminExists } from "./localAuth";
|
||||
import { classifyArticle } from "./aiClassifier";
|
||||
import { getDb } from "./db";
|
||||
@@ -372,6 +372,8 @@ export const appRouter = router({
|
||||
sharepoint_token: z.string().optional(),
|
||||
auth_mode: z.enum(["local", "free"]).optional(),
|
||||
import_time: z.string().optional(),
|
||||
fetch_mode: z.enum(["scheduled", "interval"]).optional(),
|
||||
fetch_interval_minutes: z.string().optional(),
|
||||
})
|
||||
)
|
||||
.mutation(async ({ input }) => {
|
||||
@@ -380,6 +382,10 @@ export const appRouter = router({
|
||||
if (v !== undefined && v !== "••••••••") toSave[k] = v;
|
||||
}
|
||||
await setSettings(toSave);
|
||||
// Recharger le cron si la planification a changé
|
||||
if (toSave.import_time || toSave.fetch_mode || toSave.fetch_interval_minutes) {
|
||||
await scheduleDailyImport();
|
||||
}
|
||||
return { success: true };
|
||||
}),
|
||||
}),
|
||||
@@ -592,8 +598,8 @@ export const appRouter = router({
|
||||
}))
|
||||
.mutation(async ({ input }) => {
|
||||
await saveRssSettings(input);
|
||||
// Recharger le planificateur RSS avec les nouveaux paramètres
|
||||
await scheduleRssFetch();
|
||||
// Recharger le planificateur (la lecture RSS est intégrée dans scheduleDailyImport)
|
||||
await scheduleDailyImport();
|
||||
return { success: true };
|
||||
}),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user