lib/eol.rb
# NOTE: this assumes the tables are empty. If not, Solr will take a while...
this assumes the tables are empty. If not, Solr will take a while
this assumes the tables are empty . If not Solr will take a while
def wait_for_results(&block)
      results = []
      tries = 0
      while results.empty?
        if tries > 20
          raise "Unable to retrieve results after 20 tries."
        end
        if tries == 1
          EOL.log("WARNING: no results for #{caller.first.split[1]}",
            prefix: "!")
        end
        if tries > 0
          EOL.log("...waiting for results...")
          sleep(10)
        end
        results = yield
        tries += 1
      end
      results
    end
def wait_for_results ( & block ) results = [ ] tries = 0 while results . empty? if tries > 20 raise "Unable to retrieve results after 20 tries." end if tries == 1 EOL . log ( "WARNING: no results for #{caller.first.split[1]}" , prefix : "!" ) end if tries > 0 EOL . log ( "...waiting for results..." ) sleep ( 10 ) end results = yield tries += 1 end results end
NOTE: this assumes the tables are empty.
NOTE : this assumes the tables are empty .
block
<not_specific>