view · edit · sidebar · attach · print · history

20101022-debug-export_chde_xls


  1. Check the result of test yesterday
  2. Test on production server

Goal
  • debug export_chde_xls de.oddb.org / 100 %
Milestones
  1. Check the result of test yesterday 7:50
  2. Commit and pull and test it on production server
Summary
Commits
ToDo Tomorrow
Keep in Mind
Attached Files

Check the result of test yesterday

Experiment (in my local)

de.oddb.org/lib/oddb/export/server.rb

      def Server.safe_export(exporter_class, name, *args, &block)
        dir = ODDB.config.export_dir or raise "Please configure 'export_dir'"
        FileUtils.mkdir_p(dir)
        Tempfile.open(name, dir) { |fh|
          exporter = exporter_class.new
          args.push fh
          exporter.export *args
          fh.close
          newpath = File.join(dir, name)
          FileUtils.mv(fh.path, newpath)
          FileUtils.chmod(0644, newpath)
          compress(dir, name)

if(exporter_class ==  Export::Xls::ComparisonDeCh)
  unless(exporter.error_data.empty?)
    message = "\nThe following data was not able to be compared due to NoMethodError:\n"
    backtrace_info = "The original backtrace information:\n" + exporter.backtrace_info.join("\n").to_s + "\n"
    raise NoMethodError, message + exporter.error_data.join("\n").to_s + "\n\n" + backtrace_info
  end
end
        }
        name

de.oddb.org/lib/oddb/export/xls.rb

class ComparisonDeCh
  attr_reader :error_data
  attr_reader :backtrace_info

  def collect_comparables(drb_uri)
    data = []

@error_data = []
@backtrace_info = []
count = 0
    DRb::DRbObject.new(nil, drb_uri).remote_each_package { |remote|
count += 1
      package = Remote::Drugs::Package.new(drb_uri, remote,
                                           1.0 / currency_rate,
                                           tax_factor)
begin
if count == 1 or count == 2
  raise NoMethodError
end
      if(package.price(:public) \
         && (comparable = package.local_comparables.select { |pac|
            pac.price(:public)
          }.sort_by { |pac|
            pac.price(:public)
          }.first))

        data.push [comparable, package]
      end
rescue NoMethodError => err
  @error_data.push("http://ch.oddb.org/en/gcc/compare/ean13/" + package.code(:ean).value)
  @backtrace_info.push("\nhttp://ch.oddb.org/en/gcc/compare/ean13/" + package.code(:ean).value)
  @backtrace_info.concat err.backtrace
end
      nil # don't return data from the block across drb
    }
    data
  end

Run export_chde_xls

Result Email Thu Oct 21 17:11:00 2010: ODDB::Export::Xls::ComparisonDeCh

Thu Oct 21 17:11:00 2010: ODDB::Export::Xls::ComparisonDeCh#export
NoMethodError

The following data was not able to be compared due to NoMethodError:
http://ch.oddb.org/en/gcc/compare/ean13/7680546700362
http://ch.oddb.org/en/gcc/compare/ean13/7680583510016

The original backtrace information:

http://ch.oddb.org/en/gcc/compare/ean13/7680546700362
/home/masa/ywesee/de.oddb.org/lib/oddb/export/xls.rb:39:in `collect_comparables'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `call'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'
/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'
/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'
/home/masa/ywesee/de.oddb.org/lib/oddb/util/job.rb:13:in `run'
jobs/export_chde_xls:16

http://ch.oddb.org/en/gcc/compare/ean13/7680583510016
/home/masa/ywesee/de.oddb.org/lib/oddb/export/xls.rb:39:in `collect_comparables'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `call'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `__send__'
/usr/lib64/ruby/1.8/drb/drb.rb:1556:in `perform_without_block'
/usr/lib64/ruby/1.8/drb/drb.rb:1516:in `perform'
/usr/lib64/ruby/1.8/drb/drb.rb:1590:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1586:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1582:in `main_loop'
/usr/lib64/ruby/1.8/drb/drb.rb:1431:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `start'
/usr/lib64/ruby/1.8/drb/drb.rb:1428:in `run'
/usr/lib64/ruby/1.8/drb/drb.rb:1348:in `initialize'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `new'
/usr/lib64/ruby/1.8/drb/drb.rb:1628:in `start_service'
/home/masa/ywesee/de.oddb.org/lib/oddb/util/job.rb:13:in `run'
jobs/export_chde_xls:16

/home/masa/ywesee/de.oddb.org/lib/oddb/export/server.rb:68:in `safe_export'
/usr/lib64/ruby/1.8/tempfile.rb:172:in `open'
/home/masa/ywesee/de.oddb.org/lib/oddb/export/server.rb:54:in `safe_export'
/home/masa/ywesee/de.oddb.org/lib/oddb/export/server.rb:25:in `export_chde_xls'
jobs/export_chde_xls:17
/home/masa/ywesee/de.oddb.org/lib/oddb/util/job.rb:16:in `call'
/home/masa/ywesee/de.oddb.org/lib/oddb/util/job.rb:16:in `run'
jobs/export_chde_xls:16

Test on production server

Commit

view · edit · sidebar · attach · print · history
Page last modified on October 22, 2010, at 08:08 AM