debian-mirror-gitlab/lib/gitlab/background_migration/expire_o_auth_tokens.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
478 B
Ruby
Raw Normal View History

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