anmo 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/anmo/application.rb +3 -2
- data/lib/anmo/version.rb +1 -1
- metadata +1 -1
data/lib/anmo/application.rb
CHANGED
@@ -2,6 +2,7 @@ require "dalli"
|
|
2
2
|
|
3
3
|
module Anmo
|
4
4
|
class ApplicationDataStore
|
5
|
+
TTL = 1000000
|
5
6
|
def self.objects
|
6
7
|
cached_objects = server.get("objects")
|
7
8
|
return JSON.load(cached_objects) if cached_objects
|
@@ -17,13 +18,13 @@ module Anmo
|
|
17
18
|
def self.insert_object object
|
18
19
|
all_objects = objects
|
19
20
|
all_objects.unshift(object)
|
20
|
-
server.set("objects", JSON.dump(all_objects))
|
21
|
+
server.set("objects", JSON.dump(all_objects), TTL)
|
21
22
|
end
|
22
23
|
|
23
24
|
def self.save_request request
|
24
25
|
all_requests = requests
|
25
26
|
all_requests << request
|
26
|
-
server.set("requests", JSON.dump(all_requests))
|
27
|
+
server.set("requests", JSON.dump(all_requests), TTL)
|
27
28
|
end
|
28
29
|
|
29
30
|
def self.clear_objects
|
data/lib/anmo/version.rb
CHANGED