Method: RQ::Executor#execute

Defined in:
lib/rq/executor.rb

#executeObject

–{{{



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/rq/executor.rb', line 17

def execute
#--{{{
  set_q
  sql = @argv.join ' '
  if sql.empty? and stdin? 
    debug{ "reading sql from stdin" }
    while((buf = stdin.gets))
      buf.strip!
      buf.gsub! %r/#.*$/o, ''
      next if buf.empty?
      sql << "#{ buf } "
    end
  end
  abort "no sql to execute" if sql.empty?
  @q.qdb.transaction_retries = 0
  @q.transaction{@q.execute(sql, &dumping_yaml_tuples)}
#--}}}
end