Skip to content

Commit

Permalink
refactor: title 편집 예외 처리 및 Polling 10초 Timeout 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
yangchef1 committed Nov 20, 2024
1 parent 1c55fde commit 60f7c7d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/server/src/task/service/broadcast.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export class BroadcastService {
private connections: Map<number, CustomResponse[]> = new Map();

addConnection(projectId: number, res: CustomResponse) {
res.setTimeout(10000);
if (!this.connections.has(projectId)) {
this.connections.set(projectId, [res]);
} else {
Expand Down
6 changes: 5 additions & 1 deletion apps/server/src/task/service/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ export class TaskService {
this.eventEmitter.on(
'operationAdded',
async (userId: number, projectId: number, taskId: number) => {
await this.dequeue(userId, projectId, taskId);
try {
await this.dequeue(userId, projectId, taskId);
} catch (e) {
throw new BadRequestException(e.message);
}
}
);
}
Expand Down

0 comments on commit 60f7c7d

Please sign in to comment.