lib/cpee/implementation.rb in cpee-2.0.1 vs lib/cpee/implementation.rb in cpee-2.0.2
- old
+ new
@@ -257,15 +257,16 @@
class DeleteInstance < Riddl::Implementation #{{{
def response
opts = @a[0]
redis = opts[:redis]
id = @r[0].to_i
- unless redis.exists("instance:#{id}/state")
+ unless redis.exists?("instance:#{id}/state")
@status = 404
return
end
+ empt = redis.keys("instance:#{id}/*").to_a
redis.multi do |multi|
- multi.del redis.keys("instance:#{id}/*").to_a
+ multi.del empt
multi.zrem 'instances', id
end
end
end #}}}