Permalink
Browse files

Reduce memory use

  • Loading branch information...
1 parent 52afddc commit 75fe140779cc762775c6161a8410249ebfa5b3d1 @biow0lf committed Apr 19, 2012
Showing with 4 additions and 2 deletions.
  1. +4 −2 app/models/acl.rb
View
@@ -1,10 +1,12 @@
# encoding: utf-8
+#require 'open-uri'
+
class Acl
def self.create_redis_cache(vendor_name, branch_name, url)
branch = Branch.where(vendor: vendor_name, name: branch_name).first
file = open(URI.escape(url)).read
- Maintainer.all.each do |maintainer|
+ Maintainer.select('login').all.each do |maintainer|
$redis.del("#{branch.name}:maintainers:#{maintainer.login}")
end
file.each_line do |line|
@@ -24,7 +26,7 @@ def self.update_redis_cache(vendor_name, branch_name, url)
branch = Branch.where(vendor: vendor_name, name: branch_name).first
file = open(URI.escape(url)).read
$redis.multi
- Maintainer.all.each do |maintainer|
+ Maintainer.select('login').all.each do |maintainer|
$redis.del("#{branch.name}:maintainers:#{maintainer.login}")
end
file.each_line do |line|

0 comments on commit 75fe140

Please sign in to comment.