mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-20 13:38:15 +02:00
Improve invoice verification caching with conflict resolution and error handling
Implement unique constraint on invoice verification cache key and handle duplicate entries gracefully in the backend. Replit-Commit-Author: Agent Replit-Commit-Session-Id: d43bd811-9372-45a7-8ac9-4a954c0538e1 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/d43bd811-9372-45a7-8ac9-4a954c0538e1/g5c0JYM
This commit is contained in:
1 parent
77e3214491
commit
80ca426a33
4 files changed
+29
-3
No files matched your search
@@ -64,6 +64,11 @@ export class InvoiceVerificationService {
|
||||
|
||||
console.log('💾 Résultat sauvé en cache:', { invoiceReference, groupId, exists: result.exists });
|
||||
} catch (error) {
|
||||
// Gérer spécifiquement les erreurs de contrainte unique (duplicate key)
|
||||
if (error && typeof error === 'object' && 'code' in error && error.code === '23505') {
|
||||
console.log('🔄 Cache déjà existant pour cette clé, ignoré:', { invoiceReference, groupId });
|
||||
return;
|
||||
}
|
||||
console.error('❌ Erreur sauvegarde cache:', error);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user