diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-11-28 11:43:17 +0100 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2018-11-28 11:43:17 +0100 |
commit | b7f35e893999b6cf1bc003747f28861be3412ab1 (patch) | |
tree | 5ca8bd63259b33d8407f41441742298894d20244 /lib/gitlab/background_migration | |
parent | 7d2b37bc48ca3963c241f384c8f2df6e937c74d6 (diff) | |
download | gitlab-ce-b7f35e893999b6cf1bc003747f28861be3412ab1.tar.gz |
Expire application settings after encrypting tokens
Diffstat (limited to 'lib/gitlab/background_migration')
-rw-r--r-- | lib/gitlab/background_migration/models/encrypt_columns/settings.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/background_migration/models/encrypt_columns/settings.rb b/lib/gitlab/background_migration/models/encrypt_columns/settings.rb index 578d2ee7fbf..7caed7f77aa 100644 --- a/lib/gitlab/background_migration/models/encrypt_columns/settings.rb +++ b/lib/gitlab/background_migration/models/encrypt_columns/settings.rb @@ -9,10 +9,15 @@ module Gitlab # class Settings < ActiveRecord::Base include ::EachBatch + include ::CacheableAttributes self.table_name = 'application_settings' self.inheritance_column = :_type_disabled + after_commit do + ApplicationSetting.expire + end + def runners_registration_token=(value) self.runners_registration_token_encrypted = ::Gitlab::CryptoHelper.aes256_gcm_encrypt(value) |