From f992060a878f139918a20d0f77a22933a73f52bc Mon Sep 17 00:00:00 2001 From: Michael Della Bitta Date: Thu, 2 Jan 2025 14:00:55 -0500 Subject: [PATCH] Fixed LazyList for Oai Files. --- .../dpla/ingestion3/harvesters/file/OaiFileHarvester.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/scala/dpla/ingestion3/harvesters/file/OaiFileHarvester.scala b/src/main/scala/dpla/ingestion3/harvesters/file/OaiFileHarvester.scala index 5200812e4..97bab32e2 100644 --- a/src/main/scala/dpla/ingestion3/harvesters/file/OaiFileHarvester.scala +++ b/src/main/scala/dpla/ingestion3/harvesters/file/OaiFileHarvester.scala @@ -151,13 +151,13 @@ class OaiFileHarvester( .getOrElse( throw new IllegalArgumentException("Couldn't load ZIP files.") ) - for (result <- iter(inputStream)) { + iter(inputStream).foreach(result => { handleFile(result, unixEpoch) match { case Failure(exception) => logger.error(s"Caught exception on $inFile.", exception) case Success(_) => //do nothing } - } + }) IOUtils.closeQuietly(inputStream) })