feat: add oban dependency for background jobs

Add Oban ~> 2.18 with SQLite support (Oban.Engines.Lite) for durable
background job processing. Configure aggressive pruning (60s max_age)
to keep database lean, with a dedicated images queue.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-21 22:01:08 +00:00
parent adaa564f4c
commit dbadd2a376
4 changed files with 15 additions and 1 deletions

View File

@@ -73,6 +73,15 @@ config :logger, :default_formatter,
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason
# Oban configuration for background jobs
config :simpleshop_theme, Oban,
engine: Oban.Engines.Lite,
repo: SimpleshopTheme.Repo,
plugins: [
{Oban.Plugins.Pruner, max_age: 60}
],
queues: [images: 2]
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{config_env()}.exs"

View File

@@ -35,3 +35,6 @@ config :phoenix, :plug_init_mode, :runtime
# Enable helpful, but potentially expensive runtime checks
config :phoenix_live_view,
enable_expensive_runtime_checks: true
# Use inline testing mode for Oban
config :simpleshop_theme, Oban, testing: :inline