Skip to content

Commit

Permalink
chore: cast sync and flush events in client_handler (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
abc3 committed Jun 12, 2024
1 parent ed8840b commit 3321c10
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.60
1.1.61
13 changes: 11 additions & 2 deletions lib/supavisor/client_handler.ex
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,19 @@ defmodule Supavisor.ClientHandler do
{:keep_state_and_data, handle_actions(data)}
end

def handle_event(:info, {proto, _, <<?S, 4::32>> = msg}, _, data)
def handle_event(:info, {proto, _, <<?S, 4::32, _::binary>> = msg}, _, data)
when proto in [:tcp, :ssl] do
Logger.debug("ClientHandler: Receive sync while not idle")
Db.cast(data.db_pid, self(), msg)
{_, db_pid} = data.db_pid
Db.cast(db_pid, self(), msg)
:keep_state_and_data
end

def handle_event(:info, {proto, _, <<?H, 4::32, _::binary>> = msg}, _, data)
when proto in [:tcp, :ssl] do
Logger.debug("ClientHandler: Receive flush while not idle")
{_, db_pid} = data.db_pid
Db.cast(db_pid, self(), msg)
:keep_state_and_data
end

Expand Down

0 comments on commit 3321c10

Please sign in to comment.