folio-data-import 0.2.8rc9__tar.gz → 0.2.8rc11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of folio-data-import might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: folio_data_import
3
- Version: 0.2.8rc9
3
+ Version: 0.2.8rc11
4
4
  Summary: A python module to interact with the data importing capabilities of the open-source FOLIO ILS
5
5
  License: MIT
6
6
  Author: Brooks Travis
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "folio_data_import"
3
- version = "0.2.8rc9"
3
+ version = "0.2.8rc11"
4
4
  description = "A python module to interact with the data importing capabilities of the open-source FOLIO ILS"
5
5
  authors = ["Brooks Travis <brooks.travis@gmail.com>"]
6
6
  license = "MIT"
@@ -327,7 +327,8 @@ class MARCImportJob:
327
327
  )
328
328
  raise e
329
329
 
330
- async def read_total_records(self, files) -> int:
330
+ @staticmethod
331
+ async def read_total_records(files) -> int:
331
332
  """
332
333
  Reads the total number of records from the given files.
333
334
 
@@ -388,6 +389,7 @@ class MARCImportJob:
388
389
  self.error_records += len(self.record_batch)
389
390
  self.pbar_sent.total = self.pbar_sent.total - len(self.record_batch)
390
391
  self.record_batch = []
392
+ await self.get_job_status()
391
393
  sleep(self.batch_delay)
392
394
 
393
395
  async def process_records(self, files, total_records) -> None:
@@ -419,7 +421,6 @@ class MARCImportJob:
419
421
  == (total_records - self.error_records),
420
422
  ),
421
423
  )
422
- await self.get_job_status()
423
424
  sleep(0.25)
424
425
  if record:
425
426
  if self.marc_record_preprocessor:
@@ -634,8 +635,8 @@ class MARCImportJob:
634
635
  self.current_retry_timeout = None
635
636
  except (httpx.ConnectTimeout, httpx.ReadTimeout, httpx.HTTPStatusError) as e:
636
637
  error_text = e.response.text if hasattr(e, "response") else str(e)
637
- if (self._max_summary_retries > self._summary_retries and not hasattr(e, "response")) or (
638
- e.response.status_code in [502, 504] and not self.let_summary_fail
638
+ if (self._max_summary_retries > self._summary_retries) and (not hasattr(e, "response") or (
639
+ hasattr(e, "response") and e.response.status_code in [502, 504]) and not self.let_summary_fail
639
640
  ):
640
641
  logger.warning(f"SERVER ERROR fetching job summary: {e}. Retrying.")
641
642
  sleep(0.25)