https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43603

--- Comment #7 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 206595
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206595&action=edit
Bug 43603: Add article_request_scans.pl cron job

Polls every active article_request_scan_accounts row's configured
Koha::File::Transport for new .zip files, matches each one's
idlink.txt/datalink.txt mapping against PROCESSING/SCAN article
requests via Koha::ArticleRequest::ScanImport, and archives
processed/failed zips into processed/ and error/ subdirectories.
Already-processed filenames (per account, via article_request_scan_log)
are never reprocessed, and the idempotency check happens before
download. Archive-move failures are logged rather than left silent, so
a misconfigured or unwritable transport shows up in the cron log
instead of just quietly leaving a zip in place.

For a Local transport, processed/ and error/ are created under the
configured download_directory before archiving into them (in confirm
mode only): Local's rename_file() is a plain File::Copy::move(),
which does not create missing destination directories on its own.

This replaces misc/migration_tools/complete_article_requests.pl (the
2018-era match_scans/search_scans_in_process script), which bug 20570
deliberately left in place while it reworked the REST API side of
article request completion. This bug depends on bug 20570 for that
REST API work.

Test plan:
1. Apply this patch series
2. Configure a file transport (admin/file_transports.pl) and a scan
   account (admin/article_request_scan_accounts.pl) referencing it -
   note the new "Article request scan accounts" link on the
   Administration home page
3. Build a zip containing a scanned file plus an idlink.txt mapping it
   to a PROCESSING/SCAN article request
4. Run misc/cronjobs/article_request_scans.pl -c -v and confirm the
   request completes with a working urls value, and the zip is moved
   into the transport's processed/ directory
5. Repeat with a zip mapping to a nonexistent or already-COMPLETED
   request and confirm it is reported as an error, archived into
   error/, and logged to article_request_scan_log without stopping
   processing of other accounts
6. Run the new test suites:
     prove t/db_dependent/Koha/ArticleRequestScanAccounts.t \
           t/db_dependent/Koha/ArticleRequestScanLogs.t \
           t/db_dependent/Koha/ArticleRequest/ScanImport.t

Co-Authored-By: Claude Sonnet 5 <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to