2022-07-16 23:28:13 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module BackgroundMigration
|
|
|
|
# Add expiry to all OAuth access tokens
|
|
|
|
class ExpireOAuthTokens < ::Gitlab::BackgroundMigration::BatchedMigrationJob
|
2023-03-17 16:20:25 +05:30
|
|
|
scope_to ->(relation) { relation.where(expires_in: nil) }
|
|
|
|
operation_name :update_all
|
|
|
|
feature_category :database
|
2023-01-13 00:05:48 +05:30
|
|
|
|
2022-07-16 23:28:13 +05:30
|
|
|
def perform
|
2023-03-17 16:20:25 +05:30
|
|
|
each_sub_batch do |sub_batch|
|
|
|
|
sub_batch.update_all(expires_in: 2.hours)
|
2022-07-16 23:28:13 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|