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
|
||||
|
||||
# Extract database from path if present
|
||||
redis_database = case redis_uri.path do
|
||||
nil -> 0
|
||||
"/" -> 0
|
||||
path ->
|
||||
path |> String.trim_leading("/") |> String.to_integer()
|
||||
redis_database = try do
|
||||
case redis_uri.path do
|
||||
nil -> 0
|
||||
"/" -> 0
|
||||
path ->
|
||||
path |> String.trim_leading("/") |> String.to_integer()
|
||||
end
|
||||
rescue
|
||||
_ -> 0
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue