From: Alexander Strizhakov <alex.strizhakov@gmail.com>
Date: Sat, 27 Feb 2021 06:39:15 +0000 (+0300)
Subject: don't use continue in Stats init for test env
X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=da5d21a1cf6050e35bbc8637b2fc7c44a8476994;p=akkoma

don't use continue in Stats init for test env
---

diff --git a/lib/pleroma/stats.ex b/lib/pleroma/stats.ex
index b096a9b1e..3e3f24c2c 100644
--- a/lib/pleroma/stats.ex
+++ b/lib/pleroma/stats.ex
@@ -23,7 +23,11 @@ defmodule Pleroma.Stats do
 
   @impl true
   def init(_args) do
-    {:ok, nil, {:continue, :calculate_stats}}
+    if Pleroma.Config.get(:env) != :test do
+      {:ok, nil, {:continue, :calculate_stats}}
+    else
+      {:ok, calculate_stat_data()}
+    end
   end
 
   @doc "Performs update stats"