diff --git a/server/storage.ts b/server/storage.ts index 9b4a088..59fcb47 100644 --- a/server/storage.ts +++ b/server/storage.ts @@ -860,15 +860,17 @@ class BunnyStorage implements IStorage { console.warn(`Database update failed for video ${id}, using cache:`, dbError); } - // If database update was successful, invalidate cache to refresh with updated data + // If database update was successful, just update local cache - don't sync from Bunny.net if (dbUpdateSuccessful) { try { - const { videoSyncService } = await import('./videoSync'); - console.log(`Invalidating cache for updated video ${id}...`); - await videoSyncService.initialize(); - console.log(`Cache invalidated after updating video ${id}`); - } catch (syncError) { - console.warn('Failed to invalidate cache after video update:', syncError); + const existing = this.videos.get(id); + if (existing) { + const updatedVideo = { ...existing, ...updates, updatedAt: new Date() }; + this.videos.set(id, updatedVideo); + console.log(`Updated video ${id} in local cache`); + } + } catch (cacheError) { + console.warn('Failed to update local cache after video update:', cacheError); } }