aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-06-17 12:54:13 +0300
committerrinpatch <rinpatch@sdf.org>2020-07-15 15:26:35 +0300
commit7882f28569bfaee2996d059990eec279415f0785 (patch)
tree169e692233f63e90af8a389c379ecd9dcef9d39d /lib
parent00926a63fb174a8bcb2f496921c5d17e04e44b1d (diff)
downloadpleroma-7882f28569bfaee2996d059990eec279415f0785.tar.gz
Use erlang monotonic time for CRF calculation
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/gun/connection_pool/worker.ex4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pleroma/gun/connection_pool/worker.ex b/lib/pleroma/gun/connection_pool/worker.ex
index 8467325f3..418cb18c1 100644
--- a/lib/pleroma/gun/connection_pool/worker.ex
+++ b/lib/pleroma/gun/connection_pool/worker.ex
@@ -12,7 +12,7 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
def init([key, uri, opts, client_pid]) do
with {:ok, conn_pid} <- Gun.Conn.open(uri, opts),
Process.link(conn_pid) do
- time = :os.system_time(:second)
+ time = :erlang.monotonic_time()
{_, _} =
Registry.update_value(@registry, key, fn _ ->
@@ -31,7 +31,7 @@ defmodule Pleroma.Gun.ConnectionPool.Worker do
@impl true
def handle_cast({:add_client, client_pid, send_pid_back}, %{key: key} = state) do
- time = :os.system_time(:second)
+ time = :erlang.monotonic_time()
{{conn_pid, _, _, _}, _} =
Registry.update_value(@registry, key, fn {conn_pid, used_by, crf, last_reference} ->