Files
evilspins/server/plugins/initialSync.ts
valere ba943be467
All checks were successful
Deploy App / build (push) Successful in 49s
Deploy App / deploy (push) Successful in 14s
try fix CI 3
2026-02-10 19:26:11 +01:00

21 lines
587 B
TypeScript

import { syncCardsWithDatabase } from '../services/cardSync.service'
export default defineNitroPlugin(async (nitroApp) => {
const folderPath = 'mnt/media/files/music'
if (!folderPath) {
console.warn('⚠️ NUXT_PATH_FILES non configuré')
return
}
// Sync au démarrage
console.log('🚀 Synchronisation initiale au démarrage...')
try {
const result = await syncCardsWithDatabase(folderPath)
console.log('✅ Synchronisation initiale terminée:', result)
} catch (error: any) {
console.error('❌ Erreur lors de la sync initiale:', error)
}
})