Files
evilspins/server/tasks/syncCards.ts
valere ffd5c5d7eb
All checks were successful
Deploy App / build (push) Successful in 49s
Deploy App / deploy (push) Successful in 22s
try fix .env with NUXT_ prefix
2026-02-10 18:44:00 +01:00

23 lines
671 B
TypeScript

import { syncCardsWithDatabase } from '../services/cardSync.service'
export default defineTask({
meta: {
name: 'sync-tracks',
description: 'Synchronise les tracks avec le système de fichiers'
},
async run() {
const folderPath = process.env.NUXT_PATH_FILES
console.log('⏰ [TASK] Démarrage de la synchronisation planifiée...')
try {
const result = await syncCardsWithDatabase(folderPath)
console.log('✅ [TASK] Synchronisation terminée:', result)
return { result }
} catch (error: any) {
console.error('❌ [TASK] Erreur lors de la synchronisation:', error)
return { error: error.message }
}
}
})