feat: Add stale process monitor, users route, landing page, archive old scripts
- Add backend stale process monitoring API (/api/stale-processes) - Add users management route - Add frontend landing page and stale process monitor UI on /scraper-tools - Move old development scripts to backend/archive/ - Update frontend build with new features 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
40
backend/archive/check-jobs.ts
Normal file
40
backend/archive/check-jobs.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import pg from 'pg';
|
||||
|
||||
const client = new pg.Client({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
});
|
||||
|
||||
async function checkJobs() {
|
||||
await client.connect();
|
||||
|
||||
const statusRes = await client.query(`
|
||||
SELECT status, COUNT(*) as count
|
||||
FROM brand_scrape_jobs
|
||||
WHERE dispensary_id = 112
|
||||
GROUP BY status
|
||||
ORDER BY status
|
||||
`);
|
||||
|
||||
console.log('\n📊 Job Status Summary:');
|
||||
console.log('====================');
|
||||
statusRes.rows.forEach(row => {
|
||||
console.log(`${row.status}: ${row.count}`);
|
||||
});
|
||||
|
||||
const activeRes = await client.query(`
|
||||
SELECT worker_id, COUNT(*) as count
|
||||
FROM brand_scrape_jobs
|
||||
WHERE dispensary_id = 112 AND status = 'in_progress'
|
||||
GROUP BY worker_id
|
||||
`);
|
||||
|
||||
console.log('\n👷 Active Workers:');
|
||||
console.log('==================');
|
||||
activeRes.rows.forEach(row => {
|
||||
console.log(`${row.worker_id}: ${row.count} jobs`);
|
||||
});
|
||||
|
||||
await client.end();
|
||||
}
|
||||
|
||||
checkJobs();
|
||||
Reference in New Issue
Block a user