lib/helpers/data.rb in gaptool-server-0.6.0 vs lib/helpers/data.rb in gaptool-server-0.6.3
- old
+ new
@@ -233,19 +233,20 @@
role = $redis.get(key)
if !role.nil?
$redis.multi do |m|
m.del(key)
m.srem("apps", name)
- m.srem("role:#{role}")
+ m.srem("role:#{role}:apps", name)
end
else
$redis.unwatch
end
end
end
def self.get_app_data(app)
- {"role" => $redis.get("app:#{app}")}
+ role = $redis.get("app:#{app}")
+ return {"role" => role } unless role.nil?
end
def self.apps
$redis.smembers("apps")
end