Restored to 'e1314807be287b395cffa7ada2c736a4a7831e11'
Replit-Restored-To: e1314807be
This commit is contained in:
+6
-12
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user