Skip to content

Commit

Permalink
increase cache time
Browse files Browse the repository at this point in the history
  • Loading branch information
digitaltom committed Mar 8, 2012
1 parent 470c4f2 commit eec85e2
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/models/seeker.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ def self.prepare_result(query, baseproject=nil, project=nil, exclude_filter=nil,
cache_key += "_#{exclude_debug}" if exclude_debug
cache_key += "_#{project}" if project
cache_key = 'searchresult_' + MD5::md5( cache_key ).to_s
Rails.cache.fetch(cache_key, :expires_in => 10.minutes) do
Rails.cache.fetch(cache_key, :expires_in => 60.minutes) do
SearchResult.search(query, baseproject, project, exclude_filter, exclude_debug)
end
end


class SearchResult < Array
def self.search(query, baseproject, project=nil, exclude_filter=nil, exclude_debug=false)


words = query.split(" ").select {|part| !part.match(/^[0-9_\.-]+$/) }
versrel = query.split(" ").select {|part| part.match(/^[0-9_\.-]+$/) }
logger.debug "splitted words and versrel: #{words.inspect} #{versrel.inspect}"
Expand Down

0 comments on commit eec85e2

Please sign in to comment.