From 1ef18a1b0ba57bb888ead2aa169437055036196a Mon Sep 17 00:00:00 2001 From: Silberengel Date: Thu, 23 Apr 2026 11:37:49 +0200 Subject: [PATCH] reduce the comment prewarm default to 10 --- README.md | 4 ++-- src/Command/PrewarmCommand.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 185653e..1859179 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ make prewarm | 1 | `docker compose up -d --wait` — starts **php**, **database**, and **cron** (the `cron` image runs a full `app:prewarm` on a 10 min schedule) | | 2 | `doctrine:migrations:migrate` | | 3 | `articles:get -- '-2 month' 'now'` — sync long-form into MySQL for that window | -| 4 | `app:prewarm` — magazine **30040**, **kind-0** profiles, **comment** cache (default **`--comments-max=20`**, newest by `createdAt`) | +| 4 | `app:prewarm` — magazine **30040**, **kind-0** profiles, **comment** cache (default **`--comments-max=10`**, newest by `createdAt`) | `make prewarm` brings the stack (including `cron`) up so scheduled prewarm is active. **Optional** extra arguments for the **cron**-scheduled `app:prewarm` go in **`.env`** as **`PREWARM_FLAGS`** (same as you might pass to `php bin/console app:prewarm …`); Compose passes them into the `cron` container. Example: `PREWARM_FLAGS="--metadata-limit=50 --no-magazine"`. **Restart** the `cron` service after changing `PREWARM_FLAGS` so the container reloads the env. Hub / `compose.hub.yaml` has no `cron` service; use a host timer or `exec` if you need the same there. @@ -79,7 +79,7 @@ make prewarm | `--no-comments` | off | Skip comment thread cache | | `--metadata-limit` | `0` (all authors) | Cap distinct author pubkeys | | `--metadata-batch` | `50` | Pubkeys per batched Nostr `REQ` | -| `--comments-max` | `20` | Newest **N** articles (by `createdAt` **DESC**); `0` = all (still bounded by budget) | +| `--comments-max` | `10` | Newest **N** articles (by `createdAt` **DESC**); `0` = all (still bounded by budget) | | `--comments-budget` | `600` | Max wall seconds for the whole comments phase (Nostr is slow; raise e.g. `1200` if you need more articles in one run) | | `--magazine-budget` | `30` | Max wall seconds for magazine refresh | diff --git a/src/Command/PrewarmCommand.php b/src/Command/PrewarmCommand.php index dd271d6..23a144c 100644 --- a/src/Command/PrewarmCommand.php +++ b/src/Command/PrewarmCommand.php @@ -56,8 +56,8 @@ final class PrewarmCommand extends Command ->addOption('magazine-budget', null, InputOption::VALUE_REQUIRED, 'Seconds wall time for magazine relay refresh', '30') ->addOption('metadata-limit', null, InputOption::VALUE_REQUIRED, 'Max distinct author pubkeys to warm (0 = all)', '0') ->addOption('metadata-batch', null, InputOption::VALUE_REQUIRED, 'Kind-0 metadata: pubkeys per Nostr REQ (batched)', '50') - ->addOption('comments-max', null, InputOption::VALUE_REQUIRED, 'Newest N articles to warm comment cache for (0 = all, order: createdAt DESC)', '20') - ->addOption('comments-budget', null, InputOption::VALUE_REQUIRED, 'Wall-clock seconds for the whole comments phase (Nostr fetches are slow; a single long thread can exceed a short budget; use 1200+ if 20+ articles)', '600'); + ->addOption('comments-max', null, InputOption::VALUE_REQUIRED, 'Newest N articles to warm comment cache for (0 = all, order: createdAt DESC)', '10') + ->addOption('comments-budget', null, InputOption::VALUE_REQUIRED, 'Wall-clock seconds for the whole comments phase (Nostr fetches are slow; a single long thread can exceed a short budget; use 1200+ if prewarming many articles)', '600'); } protected function execute(InputInterface $input, OutputInterface $output): int