c30b02681ee2fd7040159db8f42fd8d00c1dfb9f
Some checks failed
CI/CD Pipeline - Apartment API / Scan Dependencies (pull_request) Successful in 13s
CI/CD Pipeline - Apartment API / Lint & Test (pull_request) Successful in 41s
CI/CD Pipeline - Apartment API / Send Webhook Notification (pull_request) Failing after 1s
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
Implement the manual scraper trigger endpoint with the following: - Protected by requireAuth and requireAdmin middleware (401/403) - Mutex lock check via isScraperRunning to prevent concurrent runs (409) - Generates UUID jobId for tracking async scrape execution - Returns 202 Accepted immediately without blocking on scrape completion - Releases mutex lock in .finally() to ensure cleanup on success or failure - Logs ADMIN_TRIGGER_SCRAPE activity with jobId, dryRun, and usingProvidedHtml metadata via activityLogger - Supports dryRun option (defaults to false) and htmlContent for testing with pre-fetched HTML - Passes trigger: 'manual', jobId, dryRun, and htmlContent to runScrape Includes 20 tests covering auth, mutex, async execution, activity logging, dryRun/htmlContent options, and response structure.
Description
No description provided
Languages
JavaScript
97.8%
HTML
2.1%