Skip to content

Commit

Permalink
Add logging for dates and queue connection string for local connect
Browse files Browse the repository at this point in the history
  • Loading branch information
levinmr committed Aug 23, 2024
1 parent fc01897 commit aa4ad53
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ async function runQueuePublish(options = {}) {
),
{
priority: _messagePriority(reportConfig),
singletonKey: `${appConfig.scriptName}-${agency.agencyName}-${reportConfig.name}`,
singletonKey: `${appConfig.scriptName}-${agency.agencyName}-${reportConfig.name}-${reportConfig.query.dateRanges[0].startDate}`,
},
);
if (jobId) {
reportLogger.info(
`Created job in queue: ${queue} with job ID: ${jobId}`,
`Created job in queue: ${queue} with job ID: ${jobId} for ${reportConfig.query.dateRanges[0].startDate}`,
);
} else {
reportLogger.info(`Found a duplicate job in queue: ${queue}`);
Expand Down Expand Up @@ -224,7 +224,9 @@ async function runQueueConsume() {
queue,
{ newJobCheckIntervalSeconds: 1 },
async (message) => {
appLogger.info("Queue message received");
appLogger.info(
`Queue message received for ${message.data.reportConfig.query.dateRanges[0].startDate}`,
);
process.env.AGENCY_NAME = message.data.agencyName;
process.env.ANALYTICS_REPORT_IDS = message.data.analyticsReportIds;
process.env.AWS_BUCKET_PATH = message.data.awsBucketPath;
Expand Down
2 changes: 1 addition & 1 deletion src/app_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class AppConfig {
get messageQueueDatabaseConnection() {
const connection =
knexfile[process.env.NODE_ENV || "development"].connection;
return `postgres://${connection.user}:${connection.password}@${connection.host}/${process.env.MESSAGE_QUEUE_DATABASE_NAME}${process.env.NODE_ENV == "production" ? "?ssl=true" : ""}`;
return `postgres://${connection.user}:${connection.password}@${connection.host}:${process.env.POSTGRES_PORT}/${process.env.MESSAGE_QUEUE_DATABASE_NAME}${process.env.NODE_ENV == "production" ? "?ssl=true&sslmode=no-verify" : ""}`;
}

get messageQueueName() {
Expand Down

0 comments on commit aa4ad53

Please sign in to comment.