<< | Index | >>
Update-Idea Job Module with Proess Checker by pid.
module Job LOG_ROOT = File.expand_path('log', PROJECT_ROOT) PID_FILE = File.expand_path('job.pid', LOG_ROOT) def Job.run opts={}, &block => pid = Job.running_pid => job = File.basename($0) system = DRb::DRbObject.new(nil, ODDB.config.server_url) DRb.start_service begin => if pid puts "Process #{pid} is running" # email notification else File.open(PID_FILE, 'w'){ |fh| fh << [Process.pid, job, Time.now].join(',') } puts "#{PID_FILE} is created" ODBA.cache.setup ODBA.cache.clean_prefetched DRb.install_id_conv ODBA::DRbIdConv.new system.peer_cache ODBA.cache unless opts[:readonly] rescue Errno::ECONNREFUSED block.call ODDB::App.new(:auxiliary => true) end ensure => unless pid File.unlink(path) puts "#{PID_FILE} is deleted" system.unpeer_cache ODBA.cache unless opts[:readonly] end end end =>def Job.running_pid if File.exists?(PID_FILE) (File.read(PID_FILE) || '').split(',')[0] end end end
There are hidden parameters for download_export.
<input type="hidden" value="gcc" name="flavor"> <input type="hidden" value="de" name="language"> <input id="event" type="hidden" value="checkout" name="event"> <input type="hidden" value="67165720" name="state_id"> <input type="hidden" value=":!create,:!invoice.." name="pointer"> <input type="hidden" value="user" name="zone"> <input type="hidden" value="" name="download[generics.xls]"> <input type="hidden" value="1" name="months[analysis.csv]"> <input type="hidden" value="1" name="months[doctors.csv]"> <input type="hidden" value="1" name="months[doctors.yaml]"> <input type="hidden" value="12" name="months[fachinfo.yaml]"> <input type="hidden" value="12" name="months[index_therapeuticus]"> <input type="hidden" value="12" name="months[interactions.yaml]"> <input type="hidden" value="1" name="months[migel.csv]"> <input type="hidden" value="12" name="months[oddb.csv]"> <input type="hidden" value="12" name="months[oddb2.csv]"> <input type="hidden" value="12" name="months[oddb.yaml]"> <input type="hidden" value="1" name="months[patinfo.yaml]"> <input type="hidden" value="12" name="months[price_history.yaml]"> <input type="hidden" value="12" name="months[price_history.csv]"> <input type="hidden" value="1" name="months[oddb.dat]"> <input type="hidden" value="1" name="months[oddb_with_migel.dat]"> <input type="hidden" value="12" name="months[fachinfos_de.pdf]"> <input type="hidden" value="12" name="months[fachinfos_fr.pdf]"> <input type="hidden" value="1" name="months[compendium_ch.oddb.org.firefox.epub]"> <input type="hidden" value="1" name="months[compendium_ch.oddb.org.htc.prc]"> <input type="hidden" value="1" name="months[compendium_ch.oddb.org.kindle.mobi]"> <input type="hidden" value="1" name="months[compendium_ch.oddb.org.stanza.epub]"> <input type="hidden" value="12" name="months[generics.xls]"> <input type="hidden" value="1" name="months[patents.xls]"> <input type="hidden" value="12" name="months[swissdrug-update.xls]"> <input type="hidden" value="12" name="months[oddbdat]"> <input type="hidden" value="12" name="months[s31x]">