Skip to content

Commit

Permalink
fixes for workflows #1
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidd-77 committed Dec 23, 2024
1 parent f098c13 commit a25f854
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion apps/db-service/src/lib/messageQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class MessageQueue {
this.connection = await amqp.connect(this.RABBITMQ_URL);

// Handle connection errors and closure
this.connection.on("error", (err) => {
this.connection.on("error", (err:any) => {
console.error("RabbitMQ connection error:", err);
this.handleConnectionError();
});
Expand Down
1 change: 1 addition & 0 deletions apps/notification-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"@types/mongoose": "^5.11.96",
"@types/web-push": "^3.6.4",
"cors": "^2.8.5",
"amqplib": "^0.10.5",
"dotenv": "^16.4.7",
"express": "^4.21.2",
"mongoose": "^8.9.2",
Expand Down
6 changes: 3 additions & 3 deletions apps/notification-service/src/notificationQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export class NotificationQueue {
this.connection = await amqp.connect(this.RABBITMQ_URL);

// Handle connection errors and closure
this.connection.on("error", (err) => {
this.connection.on("error", (err:any) => {
console.error("RabbitMQ connection error:", err);
this.handleConnectionError();
});
Expand Down Expand Up @@ -89,7 +89,7 @@ export class NotificationQueue {
noAck: false, // Enable manual acknowledgment
},
);
} catch (error) {
} catch (error:any) {
console.error("Error setting up message consumer:", error);
// Attempt to reconnect
this.handleConnectionError();
Expand All @@ -102,7 +102,7 @@ export class NotificationQueue {
await this.connection?.close();
this.isInitialized = false;
console.log("RabbitMQ connections closed");
} catch (error) {
} catch (error:any) {
console.error("Error closing RabbitMQ connections:", error);
}
}
Expand Down

0 comments on commit a25f854

Please sign in to comment.