3. Bulk Enqueue Entries

Purpose: Dispatch all pending seed entries from the database to Redis so the worker-facts queue can process them into facts.

Prerequisites:

  • .env.local has UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN
  • Pending entries exist in seed_entry_queue with topic_category_id set
  • worker-facts should be running or started soon after to consume the messages

Cost / Duration: $0 (no AI cost) | 2 minutes

Prompt

I need to enqueue all pending seed entries to Redis for worker processing.

First, check how many pending entries we have:

```bash
bun scripts/seed/seed-from-files.ts --stats
```

If there are pending entries with `topic_category_id` set, dispatch them:

```bash
bun scripts/seed/bulk-enqueue.ts
```

This queries all entries with `status = 'pending'` and `topic_category_id IS NOT NULL`,
then enqueues `EXPLODE_CATEGORY_ENTRY` messages to Redis in batches of 500 using
pipeline calls. No additional flags are needed.

After enqueue completes, report:
1. How many entries were enqueued
2. Whether `worker-facts` is running (check if it needs to be started)

If 0 entries were enqueued, check whether entries are missing `topic_category_id`
and advise on how to fix (generate curated entries or seed from files first).

Verification

  • Enqueue script reports non-zero entries dispatched
  • Entries transition from pending to processing as workers consume them
  • Redis queue depth increases after enqueue, then decreases as workers process
  • No Redis connection errors in output

Back to index