Skip to content

Commit

Permalink
DEV: fix the build
Browse files Browse the repository at this point in the history
We need to pass "now" from the ruby since we're freezing time in the specs
  • Loading branch information
ZogStriP committed Dec 18, 2019
1 parent 330c337 commit d74585d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jobs/scheduled/check_policy.rb
Expand Up @@ -52,17 +52,17 @@ def execute(args = nil)
policy.update(next_renew_at: next_renew)
end

DB.exec <<~SQL
DB.exec <<~SQL, now: Time.zone.now
UPDATE policy_users pu
SET expired_at = now()
SET expired_at = :now
FROM post_policies pp
WHERE pp.id = pu.post_policy_id
AND pp.renew_start IS NULL
AND pp.renew_days IS NOT NULL
AND pu.accepted_at IS NOT NULL
AND pu.expired_at IS NULL
AND pu.revoked_at IS NULL
AND pu.accepted_at < now() - (INTERVAL '1 day' * pp.renew_days)
AND pu.accepted_at < :now::timestamp - (INTERVAL '1 day' * pp.renew_days)
SQL
end

Expand Down

0 comments on commit d74585d

Please sign in to comment.