LP#1662902: do not re-download EDI files that failed processing user/gmcharlt/lp1662902_edi_fetcher
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Feb 2017 17:24:35 +0000 (12:24 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Feb 2017 17:24:35 +0000 (12:24 -0500)
commit8301d6985217d2318adda3a99322927d638e495f
tree3d174b6909655a43391f5f6a965429923ef2a8a9
parent879a4952319693ba6768229d00457d4a7775e4af
LP#1662902: do not re-download EDI files that failed processing

At present, the EDI fetcher ignores files (as determined by file
name and EDI account details) that were already successfully
processed. With this patch, ones that failed processing (e.g.,
acq.edi_message.state = 'proc_error') previously are ignored
as well.

This is because most processing errors reflect conditions that
require some sort of manual intervention on the part of the materials
vendor or the Evergreen user; having edi_fetcher.pl simply redownload
and attempt to process the file has no effect other than causing
the acq.edi_message table to grow.

With this patch, the appearance of rows in acq.edi_message whose
state is 'proc_error' should be taken as a signal to the Evergreen
admin to investigate and resolve whatever issue caused the
message to not be processed; after doing that, removing the
acq.edi_message rows will allow the file to be downloaded again
(assuming it's still available on the file server).

To test
-------
[1] Arrange to create or simulate an EDI message that failed
    processing.
[2] Run edi_fetcher.pl to have it attempt to download the
    failed message in step #1; verify that the file is
    /not/ downloaded again and that no additonal acq.edi_message
    rows are created for it.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm