websocket handler: Do not log client ping frames as errors
authorrinpatch <rinpatch@sdf.org>
Thu, 10 Sep 2020 10:47:53 +0000 (13:47 +0300)
committerrinpatch <rinpatch@sdf.org>
Thu, 10 Sep 2020 18:14:23 +0000 (21:14 +0300)
lib/pleroma/web/mastodon_api/websocket_handler.ex

index 94e4595d84a932c8faf08a3382763c884fe465b6..e6010bb4a31f3ecc296439890150f7d1fdc63748 100644 (file)
@@ -64,7 +64,9 @@ defmodule Pleroma.Web.MastodonAPI.WebsocketHandler do
     {:ok, %{state | timer: timer()}}
   end
 
-  # We never receive messages.
+  # We only receive pings for now
+  def websocket_handle(:ping, state), do: {:ok, state}
+
   def websocket_handle(frame, state) do
     Logger.error("#{__MODULE__} received frame: #{inspect(frame)}")
     {:ok, state}