X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/ac01ada27496434ff20394278faafb3a0277eb8d..93a9f31bf0e1cd3d5aec478aeef65c8132b02bdd:/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