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