Files
ubicloud/prog/expire_project_invitations.rb
Enes Cakir 5757fb5607 Expire project invitation after 7 days
Long-lasting project invitation links pose a security risk because email
address ownership can change over time. I've noticed other providers
expire these links after 7 days, which I believe is a good practice.
Therefore, I've implemented the same feature. This prog now expires
project invitation links every 7 days, with checks occurring every 6
hours.
2024-09-10 19:21:45 +03:00

10 lines
206 B
Ruby

# frozen_string_literal: true
class Prog::ExpireProjectInvitations < Prog::Base
label def wait
ProjectInvitation.where { _1.expires_at < Time.now }.all.each(&:destroy)
nap 6 * 60 * 60
end
end