view · edit · sidebar · attach · print · history

20121127-debug-corrupted-data-and-updane-fi-updater

<< | Index | >>


Summary

  • Debug & Update swissmedic updater

Commits

Index


Debug corrupted data

Migel::Item as ODDB::Indication#registrations

Plugin: ODDB::SwissmedicPlugin
Error: NoMethodError
Message: undefined method `include?' for #<ODDB::Migel::Item:0x0000001fd125f8>
Backtrace:
(eval):2:in `include?'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/model/registration_observer.rb:15:in `add_registration'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/model/registration.rb:312:in `replace_observer'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/model/registration.rb:299:in `indication='
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/persistence.rb:87:in `block in update_values'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/persistence.rb:84:in `each'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/persistence.rb:84:in `update_values'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/persistence.rb:260:in `issue_update'
ch.oddb> indications.length
-> 3474
ch.oddb> indications.map{|i| i.class}.uniq
-> [ODDB::Indication]
ch.oddb> indications.map{|i| i.registrations }.flatten.map{|r| r.class }.uniq
-> [ODDB::Registration, ODDB::Migel::Item]
ch.oddb> indications.map{|i| i.registrations }.flatten.select{|r| r.class == ODDB::Migel::Item }.length
-> 1

remove this objects.

ch.oddb> ic = indications.select{|i| i.registrations.class == ODDB::Migel::Item }.first; ic.instance_eval("@registrations = ['dummy']"); ic.remove_registration('dummy');
-> dummy
ch.oddb> indications.select{|i| i.registrations.class == ODDB::Migel::Item }.first.class                                       
-> NilClass

# after reboot
ch.oddb> indications.map{|i| i.registrations }.flatten.map{|r| r.class }.uniq
-> [ODDB::Registration]
commit

Update to check diff from stored objects about date


Package#feedbacks

Plugin: ODDB::SwissmedicPlugin
Error: TypeError
Message: can't dup NilClass
Backtrace:
(eval):2:in `dup'
(eval):2:in `dup'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/model/package.rb:157:in `checkout'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/model/package.rb:463:in `checkout'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/persistence.rb:240:in `issue_delete'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/oddbapp.rb:117:in `block in delete'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/failsafe.rb:10:in `call'
/home/yasuhiro/Documents/workspace/ywesee/var/ch.oddb.org/src/util/failsafe.rb:10:in `failsafe'
ch.oddb> packages.select{|pac|pac.feedbacks == nil}.length
-> 4
ch.oddb> packages.select{|pac|pac.feedbacks == nil}.each{|pac| pac.instance_eval("@feedbacks = []"); pac.feedbacks.odba_store}.length
-> 4
ch.oddb> packages.select{|pac|pac.feedbacks == nil}.length
0
ODBA::Stub was unable to replace #706284 from ODDB::Package:#220414
ODBA::Stub was unable to replace #707271 from ODDB::Package:#213182
ODBA::Stub was unable to replace #707270 from ODDB::Package:#213184
ODBA::Stub was unable to replace #707272 from ODDB::Package:#213183
ODBA::Stub was unable to replace #707274 from ODDB::Package:#213180
ODBA::Stub was unable to replace #701606 from ODDB::Package:#227062
ODBA::Stub was unable to replace #701607 from ODDB::Package:#227063
ODBA::Stub was unable to replace #701608 from ODDB::Package:#227067
ODBA::Stub was unable to replace #701609 from ODDB::Package:#227066
ODBA::Stub was unable to replace #706365 from ODDB::Package:#218860
ODBA::Stub was unable to replace #704232 from ODDB::Package:#223159
ODBA::Stub was unable to replace #706051 from ODDB::Package:#222053
ODBA::Stub was unable to replace #706052 from ODDB::Package:#222054
ODBA::Stub was unable to replace #706054 from ODDB::Package:#222058
ODBA::Stub was unable to replace #706053 from ODDB::Package:#222057
ODBA::Stub was unable to replace Array#28910183 from ODDB::Package:#255335
...

Update text_info_newssource

Currently works as name-search via rss.(fastonline).

import_news

    def import_news agent=init_agent
      updated = []
      old_news = old_textinfo_news
      news = textinfo_news(agent)
      news.keys.each do |type|
        if update_name_list = true_news(news[type], old_news)
          import_name(update_name_list, agent)
          log_news(news[type])
          type == :fi ? postprocess : nil 
          updated.concat update_name_list
        end 
      end 
      return !updated.empty?
    end

use new newssource.

z.B.

or (all list)

view · edit · sidebar · attach · print · history
Page last modified on November 27, 2012, at 04:03 PM