Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update amqp subtopic #885

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/amqp/sarra-canada-amqp.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function listen(options) {
let amqp_port = 5671;
let amqp_user = "anonymous";
let amqp_password = "anonymous";
let amqp_subtopic = "#";
let amqp_subtopic = "*.WXO-DD.#";
let amqp_queue = null;
let amqp_expires = 10800000; // three hours in milliseconds
let amqp_reconnect_limit_ms = 120000;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/eccc/alertMonitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AlertMonitor {

// hook up the amqp listener
const { connection, emitter: listener } = listen({
amqp_subtopic: `alerts.cap.#`,
amqp_subtopic: `*.WXO-DD.alerts.cap.#`,
});

// handle errors and messages
Expand Down
8 changes: 4 additions & 4 deletions src/lib/eccc/conditions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class CurrentConditions {

// hook up the amqp listener
const { connection, emitter: listener } = listen({
amqp_subtopic: `citypage_weather.xml.${config.primaryLocation.province}.#`,
amqp_subtopic: `*.WXO-DD.citypage_weather.xml.${config.primaryLocation.province}.#`,
});

// handle errors and messages
Expand All @@ -102,7 +102,7 @@ class CurrentConditions {
// make sure its relevant to us
if (!url.includes(`${this._weatherStationID}_e.xml`)) return;

this.fetchConditions();
this.fetchConditions(url);
logger.log("Received new conditions from AMQP at", date);
});

Expand All @@ -112,9 +112,9 @@ class CurrentConditions {
logger.log("Started AMQP conditions listener");
}

private fetchConditions() {
private fetchConditions(url: string = this._apiUrl) {
axios
.get(this._apiUrl)
.get(url)
.then((resp) => {
// parse to weather object
const weather = new Weather(resp.data);
Expand Down
Loading