[#534] Websub fix: made SQL use UTC time zone when comparing with `valid_until` ...
authorIvan Tashkinov <ivantashkinov@gmail.com>
Fri, 25 Jan 2019 15:29:43 +0000 (18:29 +0300)
committerIvan Tashkinov <ivantashkinov@gmail.com>
Fri, 25 Jan 2019 15:29:43 +0000 (18:29 +0300)
lib/pleroma/web/websub/websub.ex

index bb44425916ec5469acb7ec8c088a1c99dc8e1d44..cbb7a5ac7f068a716e232c33f56e801c47443d6a 100644 (file)
@@ -64,7 +64,7 @@ defmodule Pleroma.Web.Websub do
       from(
         sub in WebsubServerSubscription,
         where: sub.topic == ^topic and sub.state == "active",
-        where: fragment("? > NOW()", sub.valid_until)
+        where: fragment("? > (NOW() at time zone 'UTC')", sub.valid_until)
       )
 
     subscriptions = Repo.all(query)