From: Haelwenn (lanodan) Monnier Date: Tue, 5 Mar 2019 04:03:13 +0000 (+0100) Subject: [Credo] write large numbers with underscore separation X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8cd3eada7dec00f4e2ddd24c6a4286a4450281c1;p=akkoma [Credo] write large numbers with underscore separation --- diff --git a/lib/pleroma/application.ex b/lib/pleroma/application.ex index 8756e9469..cc81e1805 100644 --- a/lib/pleroma/application.ex +++ b/lib/pleroma/application.ex @@ -48,7 +48,7 @@ defmodule Pleroma.Application do [ :user_cache, [ - default_ttl: 25000, + default_ttl: 25_000, ttl_interval: 1000, limit: 2500 ] @@ -60,7 +60,7 @@ defmodule Pleroma.Application do [ :object_cache, [ - default_ttl: 25000, + default_ttl: 25_000, ttl_interval: 1000, limit: 2500 ] diff --git a/lib/pleroma/user.ex b/lib/pleroma/user.ex index 7226e1613..dbb568ca0 100644 --- a/lib/pleroma/user.ex +++ b/lib/pleroma/user.ex @@ -285,7 +285,7 @@ defmodule Pleroma.User do def needs_update?(%User{local: false, last_refreshed_at: nil}), do: true def needs_update?(%User{local: false} = user) do - NaiveDateTime.diff(NaiveDateTime.utc_now(), user.last_refreshed_at) >= 86400 + NaiveDateTime.diff(NaiveDateTime.utc_now(), user.last_refreshed_at) >= 86_400 end def needs_update?(_), do: true diff --git a/lib/pleroma/web/channels/user_socket.ex b/lib/pleroma/web/channels/user_socket.ex index aed8475fd..3a700fa3b 100644 --- a/lib/pleroma/web/channels/user_socket.ex +++ b/lib/pleroma/web/channels/user_socket.ex @@ -23,7 +23,7 @@ defmodule Pleroma.Web.UserSocket do # performing token verification on connect. def connect(%{"token" => token}, socket) do with true <- Pleroma.Config.get([:chat, :enabled]), - {:ok, user_id} <- Phoenix.Token.verify(socket, "user socket", token, max_age: 84600), + {:ok, user_id} <- Phoenix.Token.verify(socket, "user socket", token, max_age: 84_600), %User{} = user <- Pleroma.Repo.get(User, user_id) do {:ok, assign(socket, :user_name, user.nickname)} else diff --git a/lib/pleroma/web/salmon/salmon.ex b/lib/pleroma/web/salmon/salmon.ex index 47f4bdd53..0a9e51656 100644 --- a/lib/pleroma/web/salmon/salmon.ex +++ b/lib/pleroma/web/salmon/salmon.ex @@ -86,10 +86,10 @@ defmodule Pleroma.Web.Salmon do # Native generation of RSA keys is only available since OTP 20+ and in default build conditions # We try at compile time to generate natively an RSA key otherwise we fallback on the old way. try do - _ = :public_key.generate_key({:rsa, 2048, 65537}) + _ = :public_key.generate_key({:rsa, 2048, 65_537}) def generate_rsa_pem do - key = :public_key.generate_key({:rsa, 2048, 65537}) + key = :public_key.generate_key({:rsa, 2048, 65_537}) entry = :public_key.pem_entry_encode(:RSAPrivateKey, key) pem = :public_key.pem_encode([entry]) |> String.trim_trailing() {:ok, pem}