docker implementation

This commit is contained in:
dimitar committed 2026-02-01 13:32:37 +01:00
1 parent 7c7bb45446
commit 0c2433cac6
26 files changed
+2200 -13

No files matched your search

+1 -1
View File
@@ -223,7 +223,7 @@ export class LiveBlogUpdate {
@Column({ nullable: true })
authorId: string;
@Column({ type: 'datetime', nullable: true })
@Column({ type: 'timestamp', nullable: true })
scheduledAt: Date;
@Column({ nullable: true })
+11
View File
@@ -376,8 +376,19 @@ export class LiveBlogService implements OnModuleInit {
blogId: liveBlogId,
});
// Send periodic keep-alive messages to prevent timeout
const keepAliveInterval = setInterval(() => {
try {
response.write(`: keep-alive\n\n`);
} catch (error) {
// Client disconnected, stop sending keep-alive
clearInterval(keepAliveInterval);
}
}, 15000); // Send keep-alive every 15 seconds
// Handle client disconnect
response.on('close', () => {
clearInterval(keepAliveInterval);
this.sseClients.delete(clientId);
this.logger.log(
`Client ${clientId} disconnected from live blog ${liveBlogId}`,