X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ad4ab4603b27f2e89e4bb4a709bc04a6685ba67b..90e43e714fbc0e0b50e7403983a53d65fb9f44b6:/script/cleanup diff --git a/script/cleanup b/script/cleanup index 7601d35cf..e829be176 100755 --- a/script/cleanup +++ b/script/cleanup @@ -6,4 +6,7 @@ OauthNonce.where("timestamp < EXTRACT(EPOCH FROM NOW() - INTERVAL '1 day')").del OauthToken.where("invalidated_at < NOW() - INTERVAL '28 days'").delete_all RequestToken.where("authorized_at IS NULL AND created_at < NOW() - INTERVAL '28 days'").delete_all +Doorkeeper::AccessGrant.where("revoked_at < NOW() - INTERVAL '28 days' OR (created_at + expires_in * INTERVAL '1 second') < NOW() - INTERVAL '28 days'").delete_all +Doorkeeper::AccessToken.where("revoked_at < NOW() - INTERVAL '28 days' OR (created_at + expires_in * INTERVAL '1 second') < NOW() - INTERVAL '28 days'").delete_all + exit 0