Use logger parameter instead of console.log in createScraperIndexes
All checks were successful
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 13s
CI/CD Pipeline - Apartment API / Lint & Test (pull_request) Successful in 44s
CI/CD Pipeline - Apartment API / Send Webhook Notification (pull_request) Successful in 2s
CI/CD Pipeline - Apartment API / Build & Push Image (pull_request) Has been skipped
CI/CD Pipeline - Apartment API / Deploy to Production (pull_request) Has been skipped

Accept logger as second parameter to match the pattern used by all other
functions in scraperService.js (recordScraperRun, upsertUnits, etc.).
Replaces console.log with logger.info for production code consistency.
This commit is contained in:
2026-02-07 16:49:20 -07:00
parent 2e3ef0580c
commit fe24154518
2 changed files with 22 additions and 7 deletions

View File

@ -740,9 +740,10 @@ async function recordScraperRun(db, runData, logger) {
* Idempotent - safe to call multiple times.
*
* @param {Db} db - MongoDB database instance
* @param {Object} logger - Logger instance
* @returns {Promise<void>}
*/
async function createScraperIndexes(db) {
async function createScraperIndexes(db, logger) {
const collection = db.collection(config.COLLECTIONS.SCRAPER_RUNS);
// Compound index for querying runs by status sorted by most recent
@ -757,7 +758,7 @@ async function createScraperIndexes(db) {
{ name: 'startedAt_desc' }
);
console.log('Scraper indexes created successfully');
logger.info('Scraper indexes created successfully');
}
// ============================================================