Fix autosync continuing to run after being disabled
- Add defensive check in cron job execution to stop if autosync is disabled - Ensure isRunning flag is set to false when stopping autosync - Add logging to show when autosync is disabled and not scheduling - Fix both API route and TRPC router to properly stop service - Prevent multiple cron jobs from running simultaneously This fixes the issue where autosync would continue running even after being disabled in the GUI, causing rate limit errors and unwanted syncs.
This commit is contained in:
@@ -523,6 +523,8 @@ export const scriptsRouter = createTRPCRouter({
|
||||
console.log('Auto-sync rescheduled with new settings');
|
||||
} else {
|
||||
autoSyncService.stopAutoSync();
|
||||
// Ensure the service is completely stopped and won't restart
|
||||
autoSyncService.isRunning = false;
|
||||
console.log('Auto-sync stopped');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user