trypost/app
Maciej Dzierżek ca497e1f3c
perf(horizon): skip queues for platforms that are disabled (#321)
* perf(horizon): skip queues for platforms that are disabled

The social-publishing supervisor listens on Platform::allQueues(), which maps
over every enum case regardless of the per-platform *_ENABLED toggles. With
minProcesses => 1 that means one worker per supported platform - even on an
installation that only ever connects two or three of them.

On a single-workspace self-host that was 19 Horizon workers at roughly 75 MB
each; filtering by the toggles brought it to 9 and cut container memory from
1.66 GB to 1.06 GB, with no change in publishing behaviour.

Note on the implementation: the filter reads env() directly rather than calling
Platform::isEnabled(). Config files load alphabetically, so config('trypost.*')
does not exist yet while horizon.php is evaluated - isEnabled() would silently
return its default of true and the filter would be a no-op. This bites at
config:cache time, so it is invisible in tinker.

* refactor(horizon): filter disabled platform queues via enum

Move queue filtering to Platform::enabledQueues() and apply it from
AppServiceProvider after config has loaded, avoiding env() parsing in
horizon.php while keeping isEnabled() as the single source of truth.

* refactor(horizon): use enabledQueues directly in horizon config

Remove AppServiceProvider boot override and let isEnabled() fall back
to env when trypost config is not loaded yet.

* chore: enable Eloquent strict mode in all environments

* refactor(platform): replace enabled env key derivation with explicit match

* refactor(platform): simplify isEnabled using config default fallback

* test(platform): cover publishing queues and enabled toggles exhaustively

* refactor(platform): collapse isEnabled env fallback into one method

* refactor(platform): drop filter_var and rely on env boolean casting

* revert: keep Eloquent strict mode out of production

shouldBeStrict() in production would throw on lazy loads in queued
publish jobs and can stop posting. Restore the Laravel default.

---------

Co-authored-by: Paulo Castellano <paulo@castellanos.llc>
2026-09-03 13:51:03 -03:00
..
Actions Send the ad click IDs to Stripe alongside the UTM parameters (#323) 2026-08-31 23:01:37 -03:00
Ai Remove the post-templates feature (#296) 2026-08-19 09:34:26 -03:00
Broadcasting feat(automations): implement automation features and UI enhancements 2026-05-24 09:17:19 -03:00
Concerns refactor: settings redesign, Spanish translations, language system, strict_types 2026-03-30 00:20:43 -03:00
Console/Commands Remove the X API reads that buy nothing (#299) 2026-08-20 17:58:16 -03:00
DataTransferObjects Extract alt-text truncation onto MediaItem and close test gaps 2026-07-11 10:34:57 -03:00
Enums perf(horizon): skip queues for platforms that are disabled (#321) 2026-09-03 13:51:03 -03:00
Events Activation checklist + MCP OAuth authorize UX (#239) (#250) 2026-08-07 20:34:43 -03:00
Exceptions Connect the Pages a login only reaches through a Business Portfolio (#301) 2026-08-26 10:42:59 -03:00
Helpers fix(security): make SSRF private-network block configurable and guard the last user-URL fetches 2026-07-17 15:40:15 -03:00
Http Visible Terms and Privacy links on the auth screens (#317) 2026-09-01 18:20:38 -03:00
Jobs Fall back to display name when a published-post email has no username (#325) 2026-09-03 12:51:44 -03:00
Listeners feat: fire signup/checkout PostHog events from the backend (#277) 2026-08-12 11:47:47 -03:00
Mail Fall back to display name when a published-post email has no username (#325) 2026-09-03 12:51:44 -03:00
Mcp Use whereLike for search so MySQL works alongside PostgreSQL (#302) 2026-08-26 10:59:31 -03:00
Models Fall back to display name when a published-post email has no username (#325) 2026-09-03 12:51:44 -03:00
Observers Allow multiple social accounts per network via env (#286) 2026-08-25 07:28:14 -03:00
Passport Activation checklist + MCP OAuth authorize UX (#239) (#250) 2026-08-07 20:34:43 -03:00
Policies MCP: workspace settings, viewer read access, and token access (#241) 2026-08-06 09:54:51 -03:00
Providers Remove the post-templates feature (#296) 2026-08-19 09:34:26 -03:00
Rules Defuse links in X posts to avoid the link-post fee (#308) 2026-08-29 15:31:05 -03:00
Services Defuse links in X posts to avoid the link-post fee (#308) 2026-08-29 15:31:05 -03:00
Socialite feat(channels): add Discord as a social channel 2026-06-16 14:44:00 -03:00
Support Defuse links in X posts to avoid the link-post fee (#308) 2026-08-29 15:31:05 -03:00