Add background bulk import for Komoot
Replace the per-tour import UI with a fire-and-forget background job: - Add `import_batches` DB table tracking status, found/imported/duplicate counts - Add `runKomootBulkImport` server function that pages all Komoot tours, fetches GPX, creates activities, and deduplicates via sync_imports - Add `komoot-bulk-import` pg-boss job registered at server startup - Add POST /api/sync/komoot/import to enqueue the job - Add GET /api/sync/komoot/import-status to return the latest batch - Replace the Komoot import page with a progress UI that polls every 2s while a batch is running and shows found/imported/skipped counts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
386867ef6a
commit
5ff7af8a81
10 changed files with 442 additions and 211 deletions
|
|
@ -143,7 +143,9 @@ server.listen(port, async () => {
|
|||
// notifications wired up would silently drop fan-out enqueues.
|
||||
const { notificationsFanoutJob } = await import("./app/jobs/notifications-fanout.ts");
|
||||
const { notificationsPurgeJob } = await import("./app/jobs/notifications-purge.ts");
|
||||
jobs.push(notificationsFanoutJob, notificationsPurgeJob);
|
||||
const { komootBulkImportJob } = await import("./app/jobs/komoot-bulk-import.ts");
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
jobs.push(notificationsFanoutJob, notificationsPurgeJob, komootBulkImportJob as any);
|
||||
|
||||
const boss = createBoss(process.env.DATABASE_URL ?? "postgres://trails:trails@localhost:5432/trails");
|
||||
await startWorker(boss, jobs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue