unt-libraries / catalog-api

A Django project that lets you build and expose a REST API for your library's Sierra ILS-based catalog
BSD 3-Clause "New" or "Revised" License
17 stars 8 forks source link

Handle empty record sets during initialization of exporter jobs in Celery tasks #47

Closed jthomale closed 5 years ago

jthomale commented 5 years ago

Rarely, an exporter job will run in which no qualifying records are fetched from Sierra (e.g., during times when the library is closed and there were no updates to catalog records the previous day). Recent changes to tasks (JobPlan implementation, etc.) did not take this into account, leading to the error described in issue #46. This adds a check during job initialization and logs an appropriate message if no records were found, bypassing the code path that raised the error.

Also: _initialize_job_plan was a private function that was no longer used but hadn't been removed, so this removes that, as well.