Class: Gitlab::BackgroundMigration::BackfillProjectStatisticsStorageSizeWithRecentSize::Storage::Hashed
- Inherits:
-
Object
- Object
- Gitlab::BackgroundMigration::BackfillProjectStatisticsStorageSizeWithRecentSize::Storage::Hashed
- Defined in:
- lib/gitlab/background_migration/backfill_project_statistics_storage_size_with_recent_size.rb
Constant Summary collapse
- ROOT_PATH_PREFIX =
'@hashed'
Instance Attribute Summary collapse
-
#project ⇒ Object
Returns the value of attribute project.
Instance Method Summary collapse
- #disk_hash ⇒ Object
- #disk_path ⇒ Object
-
#initialize(project) ⇒ Hashed
constructor
A new instance of Hashed.
Constructor Details
#initialize(project) ⇒ Hashed
Returns a new instance of Hashed.
53 54 55 |
# File 'lib/gitlab/background_migration/backfill_project_statistics_storage_size_with_recent_size.rb', line 53 def initialize(project) @project = project end |
Instance Attribute Details
#project ⇒ Object
Returns the value of attribute project.
49 50 51 |
# File 'lib/gitlab/background_migration/backfill_project_statistics_storage_size_with_recent_size.rb', line 49 def project @project end |
Instance Method Details
#disk_hash ⇒ Object
61 62 63 |
# File 'lib/gitlab/background_migration/backfill_project_statistics_storage_size_with_recent_size.rb', line 61 def disk_hash @disk_hash ||= Digest::SHA2.hexdigest(project.id.to_s) end |
#disk_path ⇒ Object
57 58 59 |
# File 'lib/gitlab/background_migration/backfill_project_statistics_storage_size_with_recent_size.rb', line 57 def disk_path "#{ROOT_PATH_PREFIX}/#{disk_hash[0..1]}/#{disk_hash[2..3]}/#{disk_hash}" end |