Browse Source
Nuxt's bundler tree-shakes side-effect-only imports (import "./file"). Changed to export the handler from cleanup-logs.ts and call registerTask explicitly in the plugin to ensure the task is registered at startup. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>main
2 changed files with 6 additions and 4 deletions
@ -1,10 +1,9 @@ |
|||
import { registerTask } from "../registry"; |
|||
import log4js from "logger"; |
|||
|
|||
const logger = log4js.getLogger("SCHEDULER"); |
|||
|
|||
registerTask("cleanup-logs", async (payload) => { |
|||
export default async function cleanupLogs(payload?: Record<string, unknown>) { |
|||
const days = (payload?.days as number) ?? 30; |
|||
logger.info("Log cleanup placeholder: would remove logs older than %d days", days); |
|||
return { success: true, message: `Cleaned logs older than ${days} days` }; |
|||
}); |
|||
} |
|||
|
|||
Loading…
Reference in new issue