Oban's Lifeline plugin was rescuing PropagationGridWorker from executing back to retryable every 10 minutes (runtime.exs) or 30 minutes (config.exs / dev.exs), but one full f00–f18 sweep takes ~95 minutes and the worker's own timeout/1 is already 90 minutes. The rescue fired mid-run, the retry restarted at f00, and after 3 rescues the job was discarded with errors: [] (Lifeline rescues don't write an error summary). prod's propagation_scores never advanced beyond ~5 valid_times, so the forecast timeline on /map only showed 3–4 hours instead of the intended ~17. Raise rescue_after to 120 minutes in all three configs — past the worker's own 90-minute cap with headroom — and document the contract so the next concurrency tweak doesn't regress it. Also restore MrmsFetchWorker and AsosAdjustmentWorker to the prod cron in runtime.exs: runtime.exs replaces config.exs's plugin list wholesale and those two had been silently dropped in the last rewrite. AsosAdjustmentWorker depends on the MRMS precip cache, so both move together.
125 lines
3.8 KiB
Elixir
125 lines
3.8 KiB
Elixir
# This file is responsible for configuring your application
|
|
# and its dependencies with the aid of the Config module.
|
|
#
|
|
# This configuration file is loaded before any dependency and
|
|
# is restricted to this project.
|
|
|
|
# General application configuration
|
|
import Config
|
|
|
|
alias Microwaveprop.Workers.CanadianSoundingFetchWorker
|
|
|
|
# Configure esbuild (the version is required)
|
|
config :esbuild,
|
|
version: "0.27.4",
|
|
microwaveprop: [
|
|
args:
|
|
~w(js/app.ts --bundle --target=es2022 --outdir=../priv/static/assets/js --external:/fonts/* --external:/images/* --alias:@=.),
|
|
cd: Path.expand("../assets", __DIR__),
|
|
env: %{"NODE_PATH" => [Path.expand("../deps", __DIR__), Mix.Project.build_path()]}
|
|
]
|
|
|
|
config :live_table,
|
|
app: :microwaveprop,
|
|
repo: Microwaveprop.Repo,
|
|
pubsub: Microwaveprop.PubSub,
|
|
defaults: %{
|
|
custom_footer: {MicrowavepropWeb.LiveTableFooter, :render}
|
|
}
|
|
|
|
# Configure Elixir's Logger
|
|
config :logger, :default_formatter,
|
|
format: "$time $metadata[$level] $message\n",
|
|
metadata: [:request_id, :remote_ip]
|
|
|
|
# Configure the mailer
|
|
#
|
|
# By default it uses the "Local" adapter which stores the emails
|
|
# locally. You can see the emails in your browser, at "/dev/mailbox".
|
|
#
|
|
# For production it's recommended to configure a different adapter
|
|
# at the `config/runtime.exs`.
|
|
config :microwaveprop, Microwaveprop.Mailer, adapter: Swoosh.Adapters.Local
|
|
|
|
# Configure the endpoint
|
|
config :microwaveprop, MicrowavepropWeb.Endpoint,
|
|
url: [host: "localhost"],
|
|
adapter: Bandit.PhoenixAdapter,
|
|
render_errors: [
|
|
formats: [html: MicrowavepropWeb.ErrorHTML, json: MicrowavepropWeb.ErrorJSON],
|
|
layout: false
|
|
],
|
|
pubsub_server: Microwaveprop.PubSub,
|
|
live_view: [signing_salt: "Gdq36xze"]
|
|
|
|
config :microwaveprop, Oban,
|
|
engine: Oban.Pro.Engines.Smart,
|
|
repo: Microwaveprop.Repo,
|
|
queues: [
|
|
solar: 1,
|
|
weather: 20,
|
|
enqueue: 1,
|
|
hrrr: 5,
|
|
terrain: 4,
|
|
commercial: 2,
|
|
iemre: 10,
|
|
propagation: 1,
|
|
admin: 1,
|
|
nexrad: 2
|
|
],
|
|
plugins: [
|
|
{Oban.Plugins.Pruner, max_age: 3600 * 24},
|
|
# See runtime.exs — must exceed PropagationGridWorker's 90-min timeout.
|
|
{Oban.Plugins.Lifeline, rescue_after: to_timeout(minute: 120)},
|
|
{Oban.Plugins.Cron,
|
|
crontab: [
|
|
{"0 8 * * *", Microwaveprop.Workers.SolarIndexWorker},
|
|
{"*/5 * * * *", Microwaveprop.Commercial.PollWorker},
|
|
{"5 */3 * * *", Microwaveprop.Workers.PropagationGridWorker},
|
|
{"*/2 * * * *", Microwaveprop.Workers.MrmsFetchWorker},
|
|
{"*/10 * * * *", Microwaveprop.Workers.AsosAdjustmentWorker},
|
|
{"*/15 * * * *", Microwaveprop.Workers.PropagationPruneWorker},
|
|
# UWYO publishes the 00Z/12Z Canadian radiosondes ~90 minutes after launch
|
|
{"30 1 * * *", CanadianSoundingFetchWorker},
|
|
{"30 13 * * *", CanadianSoundingFetchWorker}
|
|
]}
|
|
]
|
|
|
|
config :microwaveprop, :scopes,
|
|
user: [
|
|
default: true,
|
|
module: Microwaveprop.Accounts.Scope,
|
|
assign_key: :current_scope,
|
|
access_path: [:user, :id],
|
|
schema_key: :user_id,
|
|
schema_type: :binary_id,
|
|
schema_table: :users,
|
|
test_data_fixture: Microwaveprop.AccountsFixtures,
|
|
test_setup_helper: :register_and_log_in_user
|
|
]
|
|
|
|
config :microwaveprop,
|
|
ecto_repos: [Microwaveprop.Repo],
|
|
generators: [timestamp_type: :utc_datetime, binary_id: true]
|
|
|
|
# Use EXLA as default Nx backend for accelerated tensor operations
|
|
config :nx, :default_backend, EXLA.Backend
|
|
|
|
# Use Jason for JSON parsing in Phoenix
|
|
config :phoenix, :json_library, Jason
|
|
|
|
# Configure tailwind (the version is required)
|
|
config :tailwind,
|
|
version: "4.2.2",
|
|
microwaveprop: [
|
|
args: ~w(
|
|
--input=assets/css/app.css
|
|
--output=priv/static/assets/css/app.css
|
|
),
|
|
|
|
# Import environment specific config. This must remain at the bottom
|
|
# of this file so it overrides the configuration defined above.
|
|
cd: Path.expand("..", __DIR__)
|
|
]
|
|
|
|
import_config "#{config_env()}.exs"
|