[#534] Websub fix: made SQL use UTC time zone when comparing with valid_until (instead of postgresql-server default time zone).

This commit is contained in:
Ivan Tashkinov 2019-01-25 18:29:43 +03:00
parent 656ed7c84a
commit 465adedb7c

View file

@ -64,7 +64,7 @@ def publish(topic, user, %{data: %{"type" => type}} = activity)
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)