Stephen Minakian df86a1423c
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 38s
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
feat: add in-process mutex to prevent concurrent scraper runs
Implement a lightweight in-process mutex lock for the scraper job
scheduler. This prevents multiple scraper instances from running
simultaneously, which could cause duplicate data and race conditions.

Exported functions:
- acquireLock(jobId): Attempts to acquire the mutex, returns boolean
- releaseLock(): Releases the mutex lock
- isScraperRunning(): Returns current lock state
- getCurrentJobId(): Returns the active job ID or null

Includes 19 unit tests covering lock acquisition, release, re-entry
prevention, and edge cases.
2026-02-06 16:25:37 -07:00
2025-07-15 17:51:26 -06:00
Description
No description provided
1.4 MiB
Languages
JavaScript 97.8%
HTML 2.1%