lib/stasis/server.rb in stasis-0.1.5 vs lib/stasis/server.rb in stasis-0.1.6
- old
+ new
@@ -19,24 +19,27 @@
request = redis.lpop('stasis:requests')
if request
files = {}
request = Yajl::Parser.parse(request)
+ paths = request['paths']
- paths = request['paths'].reject do |path|
- files[path] = redis.get("stasis:caches:#{root}:#{path}")
+ unless request['force']
+ paths = request['paths'].reject do |path|
+ files[path] = redis.get("stasis:caches:#{root}:#{path}")
+ end
end
if paths.empty? && !request['paths'].empty?
new_files = {}
else
params = request['paths'] + [
{
- :collect => request['return'],
+ :collect => request['return'] || request['force'],
:write => request['write']
}
]
- new_files = stasis.render(*params)
+ new_files = stasis.render(*params) || {}
end
if request['ttl']
new_files.each do |path, body|
key = "stasis:caches:#{root}:#{path}"
\ No newline at end of file