20120405
<< | Index | >>
summary
- Updated
swissindex_pharmad
to fix timeout problem.
- updated old dojo syntax.
commit
index
Update swissindex job
- Problem
-
It caused my TimeoutError
by savon request.
(Now swissindex plugin try 3 times.)
When request was timeout, updated value of out_of_trade was updated.
checked with only 3 packages.
in src/plugin/swissindex.rb
...
#@app.each_package do |pack|
[
@app.registration('54930').sequence('01').package('011'),
@app.registration('54931').sequence('01').package('026'),
@app.registration('53025').sequence('02').package('056')
].each do |pack|
...
Updated logic for process 1-4
- Note (as comment in code)
-
- Process1
-
- Check swissindex by eancode and then check if the package is out of trade (true) in ch.oddb,
- if so the package becomes in trade (false)
- Process2
-
- if the package does not have a pharmacode and there is a pharmacode found in swissindex,
- then put the pharmacode into ch.oddb
- We may have to cross-check the pharmacodes in the future
- Process3
-
- Process 3
- if there is no eancode in swissindex and the package is in trade in ch.oddb,
- then the package becomes out of trade (true) in ch.oddb
- Process4
-
- if there is no eancode in swissindex then delete the according pharmacode in ch.oddb
updated swissindex_pharmad
.
- pharmacode not found -> return empty hash ({})
- resucued error(timeout, standarderror) -> return nil
- found pharmacode in response by search request by EAN code. -> item hash
ch.oddb> registration('54931').sequence('01').package('026').out_of_trade
-> true
ch.oddb> Updater.new(self).update_package_trade_status_by_swissindex
-> [["yasaka@ywesee.com"]
ch.oddb> registration('54931').sequence('01').package('026').out_of_trade
-> false
Refs
Todo
to think update by xml list data.
update_old_dojo_syntax
- tooltip (label update by ajax request)
- editor
- file loading for instant search