From: Ward Vandewege Date: Thu, 12 Aug 2021 20:21:40 +0000 (-0400) Subject: 18013: address review feedback. X-Git-Tag: 2.3.0~110^2~1 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/be2e29a903a53d7565f1a52d0bebe5e5e337a1cd 18013: address review feedback. Arvados-DCO-1.1-Signed-off-by: Ward Vandewege --- diff --git a/services/api/lib/tasks/manage_long_lived_tokens.rake b/services/api/lib/tasks/manage_long_lived_tokens.rake index 8700f20f59..d83c2b6030 100644 --- a/services/api/lib/tasks/manage_long_lived_tokens.rake +++ b/services/api/lib/tasks/manage_long_lived_tokens.rake @@ -17,6 +17,7 @@ namespace :db do end if lifetime.nil? or lifetime == 0 puts("No expiration policy set (API.MaxTokenLifetime nor Login.TokenLifetime is set), nothing to do.") + # abort the rake task next end exp_date = Time.now + lifetime @@ -25,6 +26,7 @@ namespace :db do ll_tokens(lifetime).each do |auth| if auth.user.nil? printf("*** WARNING, found ApiClientAuthorization with invalid user: auth id: %d, user id: %d\n", auth.id, auth.user_id) + # skip this token next end if (auth.user.uuid =~ /-tpzed-000000000000000/).nil? @@ -45,6 +47,7 @@ namespace :db do end if lifetime.nil? or lifetime == 0 puts("No expiration policy set (API.MaxTokenLifetime nor Login.TokenLifetime is set), nothing to do.") + # abort the rake task next end user_ids = Set.new() @@ -52,6 +55,7 @@ namespace :db do ll_tokens(lifetime).each do |auth| if auth.user.nil? printf("*** WARNING, found ApiClientAuthorization with invalid user: auth id: %d, user id: %d\n", auth.id, auth.user_id) + # skip this token next end if not auth.user.nil? and (auth.user.uuid =~ /-tpzed-000000000000000/).nil?