diff options
author | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-07 16:27:53 +0300 |
---|---|---|
committer | Jacob Vosmaer <contact@jacobvosmaer.nl> | 2016-03-07 16:27:53 +0300 |
commit | 41bc9c463c187396e47b4a942965de6ecddca5a1 (patch) | |
tree | 620214ebf7850bdd2c9bd2424a66be6e732afcc7 /app/models/blob.rb | |
parent | a215e2ee8ddaefbfef16669ad0bd8ccd6853e163 (diff) |
Refactor caching code
Diffstat (limited to 'app/models/blob.rb')
-rw-r--r-- | app/models/blob.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/app/models/blob.rb b/app/models/blob.rb index 8ee9f3006b2..72e6c5fa3fd 100644 --- a/app/models/blob.rb +++ b/app/models/blob.rb @@ -1,5 +1,8 @@ # Blob is a Rails-specific wrapper around Gitlab::Git::Blob objects class Blob < SimpleDelegator + CACHE_TIME = 60 # Cache raw blobs referred to by a (mutable) ref for 1 minute + CACHE_TIME_IMMUTABLE = 3600 # Cache blobs referred to by an immutable reference for 1 hour + # Wrap a Gitlab::Git::Blob object, or return nil when given nil # # This method prevents the decorated object from evaluating to "truthy" when |