summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-12-17 19:54:24 -0200
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2018-12-17 19:57:03 -0200
commit279be8aaa28a1f5c6e6e8601eb0df579cbaf1eeb (patch)
tree8db4b368665579121cd9397eaf643b8b93ffa9c1 /lib
parentf515c25fe8256a09e0360ce9345279928daa3aab (diff)
downloadgitlab-ce-279be8aaa28a1f5c6e6e8601eb0df579cbaf1eeb.tar.gz
Change SafeRequestStore#write to accept an options hash
This change the write to accept an options hash to make it compatible with ActiveSupport::Cache::Store#write method. The options hash are not passed to the underlying cache implementation because RequestStore#write accepts only a key, and value params.
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/safe_request_store.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/gitlab/safe_request_store.rb b/lib/gitlab/safe_request_store.rb
index 4e82353adb6..d146913bdb3 100644
--- a/lib/gitlab/safe_request_store.rb
+++ b/lib/gitlab/safe_request_store.rb
@@ -19,5 +19,13 @@ module Gitlab
NULL_STORE
end
end
+
+ # This method accept an options hash to be compatible with
+ # ActiveSupport::Cache::Store#write method. The options are
+ # not passed to the underlying cache implementation because
+ # RequestStore#write accepts only a key, and value params.
+ def self.write(key, value, options = nil)
+ store.write(key, value)
+ end
end
end