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