Skip to content
This repository has been archived by the owner on Jan 4, 2025. It is now read-only.

Commit

Permalink
missing trim runtime problem
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdotb committed Feb 4, 2024
1 parent e549784 commit 4618253
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 20 deletions.
31 changes: 14 additions & 17 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,18 @@ import Config
if config_env() == :prod do
# Common

# helpers

platform_ids_from_env = fn env ->
System.get_env(env)
|> Kernel.||("")
|> String.split(",", trim: true)
|> Enum.map(fn platform_id ->
{:ok, platform_id} = Lor.Lol.PlatformIds.match(platform_id)
platform_id
end)
end

## Postgres

database_url =
Expand Down Expand Up @@ -177,14 +189,7 @@ if config_env() == :prod do
scheduler? = if System.get_env("SCHEDULER") in ~w(true 1), do: true, else: false
pro_scheduler? = if System.get_env("PRO_SCHEDULER") in ~w(true 1), do: true, else: false

scheduler_platform_ids =
System.get_env("SCHEDULER_PLATFORMS")
|> Kernel.||("")
|> String.split(",")
|> Enum.map(fn platform_id ->
{:ok, platform_id} = Lor.Lol.PlatformIds.match(platform_id)
platform_id
end)
scheduler_platform_ids = platform_ids_from_env.("SCHEDULER_PLATFORMS")

config :lor,
replay_schedulers: %{
Expand All @@ -202,15 +207,7 @@ if config_env() == :prod do
# Oban

queue_count = String.to_integer(System.get_env("QUEUE_COUNT") || "10")

queue_pro_platform_ids =
System.get_env("QUEUE_PRO_PLATFORMS")
|> Kernel.||("")
|> String.split(",")
|> Enum.map(fn platform_id ->
{:ok, platform_id} = Lor.Lol.PlatformIds.match(platform_id)
platform_id
end)
queue_pro_platform_ids = platform_ids_from_env.("QUEUE_PRO_PLATFORMS")

config :lor, Oban,
repo: Lor.Repo,
Expand Down
4 changes: 1 addition & 3 deletions lib/lor/lol/replays/worker.ex
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,7 @@ defmodule Lor.Lol.Replays.Worker do
end

def terminate(other, state) do
Logger.info(
"Replays worker terminate other #{inspect(other)} state: #{inspect(state)}"
)
Logger.info("Replays worker terminate other #{inspect(other)} state: #{inspect(state)}")

Lor.Lol.Replay.error(state.replay)

Expand Down

0 comments on commit 4618253

Please sign in to comment.