Skip to content

Commit 5e8a764

Browse files
committed
style: fix code formatting for CI
1 parent 959f713 commit 5e8a764

File tree

8 files changed

+623
-495
lines changed

8 files changed

+623
-495
lines changed

lib/phoenix/session_process/cleanup.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ defmodule Phoenix.SessionProcess.Cleanup do
101101
@impl true
102102
def handle_info({:cleanup_session, session_id}, state) do
103103
# Check if session is actually expired (might have been refreshed)
104-
if ActivityTracker.expired?(session_id) and ProcessSupervisor.session_process_started?(session_id) do
104+
if ActivityTracker.expired?(session_id) and
105+
ProcessSupervisor.session_process_started?(session_id) do
105106
session_pid = ProcessSupervisor.session_process_pid(session_id)
106107

107108
Telemetry.emit_auto_cleanup_event(

lib/phoenix/session_process/rate_limiter.ex

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,10 @@ defmodule Phoenix.SessionProcess.RateLimiter do
114114
window_start = now - @window_size_ms
115115

116116
# Count sessions created in the last minute
117-
recent_count = :ets.select_count(@table_name, [
118-
{{:_, :"$1"}, [{:>=, :"$1", window_start}], [true]}
119-
])
117+
recent_count =
118+
:ets.select_count(@table_name, [
119+
{{:_, :"$1"}, [{:>=, :"$1", window_start}], [true]}
120+
])
120121

121122
duration = System.monotonic_time() - start_time
122123

@@ -140,9 +141,10 @@ defmodule Phoenix.SessionProcess.RateLimiter do
140141
now = System.system_time(:millisecond)
141142
window_start = now - @window_size_ms
142143

143-
count = :ets.select_count(@table_name, [
144-
{{:_, :"$1"}, [{:>=, :"$1", window_start}], [true]}
145-
])
144+
count =
145+
:ets.select_count(@table_name, [
146+
{{:_, :"$1"}, [{:>=, :"$1", window_start}], [true]}
147+
])
146148

147149
{:reply, count, state}
148150
end
@@ -171,9 +173,10 @@ defmodule Phoenix.SessionProcess.RateLimiter do
171173
window_start = now - @window_size_ms
172174

173175
# Delete entries older than the sliding window
174-
deleted_count = :ets.select_delete(@table_name, [
175-
{{:_, :"$1"}, [{:<, :"$1", window_start}], [true]}
176-
])
176+
deleted_count =
177+
:ets.select_delete(@table_name, [
178+
{{:_, :"$1"}, [{:<, :"$1", window_start}], [true]}
179+
])
177180

178181
if deleted_count > 0 do
179182
Logger.debug("RateLimiter: Cleaned up #{deleted_count} old entries")

lib/phoenix/session_process/redux.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,11 @@ defmodule Phoenix.SessionProcess.Redux do
381381
end
382382
end)
383383

384-
new_redux = %{redux | current_state: target_state, history: Enum.drop(redux.history, steps_back)}
384+
new_redux = %{
385+
redux
386+
| current_state: target_state,
387+
history: Enum.drop(redux.history, steps_back)
388+
}
385389

386390
# Notify subscriptions of state change
387391
notify_subscriptions(new_redux)
@@ -577,7 +581,7 @@ defmodule Phoenix.SessionProcess.Redux do
577581
unsubscribe.()
578582
579583
"""
580-
@spec subscribe_to_broadcasts(module(), String.t(), (map() -> any())) :: (() -> :ok)
584+
@spec subscribe_to_broadcasts(module(), String.t(), (map() -> any())) :: (-> :ok)
581585
def subscribe_to_broadcasts(pubsub_module, topic, callback) do
582586
Phoenix.PubSub.subscribe(pubsub_module, topic)
583587

lib/phoenix/session_process/redux/selector.ex

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,16 @@ defmodule Phoenix.SessionProcess.Redux.Selector do
9292
state = Redux.get_state(redux)
9393

9494
# Extract values from dependency selectors recursively
95-
dep_values = Enum.map(deps, fn dep ->
96-
# Handle both simple selectors and composed selectors
97-
if is_function(dep, 1) do
98-
dep.(state)
99-
else
100-
# Recursively select for composed dependency
101-
select(redux, dep)
102-
end
103-
end)
95+
dep_values =
96+
Enum.map(deps, fn dep ->
97+
# Handle both simple selectors and composed selectors
98+
if is_function(dep, 1) do
99+
dep.(state)
100+
else
101+
# Recursively select for composed dependency
102+
select(redux, dep)
103+
end
104+
end)
104105

105106
# Check cache
106107
case get_cached_result(cache_key, dep_values) do

lib/phoenix/session_process/redux/subscription.ex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ defmodule Phoenix.SessionProcess.Redux.Subscription do
252252
pubsub_topic: nil,
253253
subscriptions: []
254254
}
255+
255256
Selector.select(redux, selector)
256257
end
257258

0 commit comments

Comments
 (0)