databasedotcom_additions 0.6.5 → 0.6.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/databasedotcom_additions/client.rb +5 -5
- metadata +1 -1
@@ -7,7 +7,7 @@ module Databasedotcom
|
|
7
7
|
attr_accessor :session_id
|
8
8
|
attr_accessor :server_url
|
9
9
|
|
10
|
-
attr_accessor :
|
10
|
+
attr_accessor :cache_mgr
|
11
11
|
attr_accessor :login_failed_user_message
|
12
12
|
|
13
13
|
alias_method :query_orig, :query
|
@@ -87,11 +87,11 @@ module Databasedotcom
|
|
87
87
|
|
88
88
|
start_time = Time.now
|
89
89
|
|
90
|
-
if
|
90
|
+
if cache_mgr
|
91
91
|
cache_key = "#{self.username}:#{soql}"
|
92
92
|
if cache[cache_key]
|
93
93
|
puts "cache get - #{cache_key}"
|
94
|
-
return
|
94
|
+
return cache_mgr.get(cache_key)
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -106,9 +106,9 @@ module Databasedotcom
|
|
106
106
|
resp['records'] = resp['records'].concat(next_resp['records'])
|
107
107
|
end
|
108
108
|
|
109
|
-
if
|
109
|
+
if cache_mgr
|
110
110
|
puts "cache put - #{cache_key}"
|
111
|
-
|
111
|
+
cache_mgr.set(cache_key, resp.to_json)
|
112
112
|
end
|
113
113
|
|
114
114
|
elapsed_time = Time.now - start_time
|