pkp / ots

PKP XML Parsing Service
GNU General Public License v3.0
32 stars 19 forks source link

graceful failure of some modules may not be working #52

Closed axfelix closed 8 years ago

axfelix commented 8 years ago

Noticed this while I was testing out the modular NER libraries; this bit of code was written by @crism to let the reference parsing fail gracefully, but I'm seeing inconsistent results right now. Need to debug a little further.

https://github.com/pkp/xmlps/blob/master/module/Manager/src/Manager/Model/Queue/Manager.php#L104

kaschioudi commented 8 years ago

if we don't want NER module to ever fail, we could remove this block https://github.com/pkp/xmlps/blob/master/module/NERExtraction/src/NERExtraction/Model/Queue/Job/NERExtractionJob.php#L36

or we could leave $config['ner']['install_path'] empty and throw ModuleNotConfigured (to be defined) exception when empty.

axfelix commented 8 years ago

That would work too, but can you see any problems with the solution that I linked? It would be helpful to be able to define modules that can fail gracefully, and I can't quite tell why it wasn't working when I tested removing the NER binary (it threw the exception and killed the job).

kaschioudi commented 8 years ago

I haven't tested your code yet but I believe this line https://github.com/pkp/xmlps/blob/master/module/NERExtraction/src/NERExtraction/Model/Queue/Job/NERExtractionJob.php#L49 needs to be moved up, before the if statement.

axfelix commented 8 years ago

OK, thanks. I'll test that to see if it makes the code in model/queue/manager work

axfelix commented 8 years ago

This is resolved!