lib/ayadn/databases.rb in ayadn-1.4.2 vs lib/ayadn/databases.rb in ayadn-1.4.3

- old
+ new

@@ -22,16 +22,12 @@ end def self.close_all if @nicerank.size > 10000 - limit = Time.now - (3600 * 168) + limit = Time.now - (3600 * 48) @nicerank.each {|k,v| @nicerank.delete(k) if v[:cached] < limit} - if @nicerank.size > 10000 - limit = Time.now - (3600 * 48) - @nicerank.each {|k,v| @nicerank.delete(k) if v[:cached] < limit} - end end Debug.db all_dbs all_dbs.each do |db| @@ -138,10 +134,10 @@ def self.get_post_from_index(number) unless number > @index.length || number <= 0 @index.each {|id, values| return values if values[:count] == number} else puts Status.must_be_in_index - Errors.global_error("databases/get_post_from_index", number, "out of range") + Errors.global_error({error: "Out of range", caller: caller, data: [number]}) end end def self.add_to_users_db_from_list(list) list.each { |id, content_array| @users[id] = {content_array[0] => content_array[1]} }