LP#1662902: do not re-download EDI files that failed processing
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Feb 2017 17:24:35 +0000 (12:24 -0500)
committerMike Rylander <mrylander@gmail.com>
Fri, 17 Feb 2017 17:27:46 +0000 (12:27 -0500)
commit35730098fb539ba6794eaed123de7a534b7f03e2
tree1ce57ff4e0961fc7d658cf7a3c516ca269374f60
parent6c537fc3a063cbb2d1c13907b3d94b6fcde09e73
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>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/perlmods/lib/OpenILS/Application/Acq/EDI.pm