docker implementation
This commit is contained in:
1 parent
7c7bb45446
commit
0c2433cac6
26 files changed
+2200
-13
No files matched your search
@@ -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 })
|
||||
|
||||
@@ -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}`,
|
||||
|
||||
Reference in new issue
Block a user