Fix syntax error in runtime.exs Redis configuration
- Wrap String.to_integer in try/rescue block properly - Fix CompileError caused by rescue clause inside case statement - Ensures runtime.exs can compile and load Redis configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
de74593d08
commit
46f68f3070
1 changed files with 7 additions and 5 deletions
|
|
@ -135,11 +135,13 @@ if config_env() == :prod do
|
||||||
end
|
end
|
||||||
|
|
||||||
# Extract database from path if present
|
# Extract database from path if present
|
||||||
redis_database = case redis_uri.path do
|
redis_database = try do
|
||||||
nil -> 0
|
case redis_uri.path do
|
||||||
"/" -> 0
|
nil -> 0
|
||||||
path ->
|
"/" -> 0
|
||||||
path |> String.trim_leading("/") |> String.to_integer()
|
path ->
|
||||||
|
path |> String.trim_leading("/") |> String.to_integer()
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
_ -> 0
|
_ -> 0
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue