Restored to 'e1314807be287b395cffa7ada2c736a4a7831e11'

Replit-Restored-To: e1314807be
This commit is contained in:
sebastjanartic
2025-09-06 19:38:50 +00:00
parent d71f6d7f28
commit 72295f7fe8
4 changed files with 38 additions and 157 deletions
+6 -12
View File
@@ -166,21 +166,15 @@ class VideoSyncService {
try {
await this.syncVideos();
// Add timeout protection for database sync with longer timeout
// Add timeout protection for database sync
const syncTimeout = new Promise((_, reject) =>
setTimeout(() => reject(new Error('Database sync timeout after 60 seconds')), 60000)
setTimeout(() => reject(new Error('Database sync timeout after 30 seconds')), 30000)
);
try {
await Promise.race([
this.syncVideosToDatabase(),
syncTimeout
]);
} catch (error) {
console.error('❌ Database sync failed with timeout:', error);
console.log('⚠️ Continuing with cached data only - videos will still be available');
// Don't throw the error, just log it and continue
}
await Promise.race([
this.syncVideosToDatabase(),
syncTimeout
]);
this.startPeriodicSync();
console.log('✅ Video sync service initialized successfully');