From 6bd7ce7321998a1831d5bfd3204b74385879347e Mon Sep 17 00:00:00 2001 From: Mehmet Butgul Date: Mon, 8 Apr 2024 18:21:34 +0300 Subject: [PATCH] closed the connection --- .../com/johnsnowlabs/nlp/pretrained/S3ResourceDownloader.scala | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/scala/com/johnsnowlabs/nlp/pretrained/S3ResourceDownloader.scala b/src/main/scala/com/johnsnowlabs/nlp/pretrained/S3ResourceDownloader.scala index 7e55fa9a699948..ef338e1811f317 100644 --- a/src/main/scala/com/johnsnowlabs/nlp/pretrained/S3ResourceDownloader.scala +++ b/src/main/scala/com/johnsnowlabs/nlp/pretrained/S3ResourceDownloader.scala @@ -53,9 +53,11 @@ class S3ResourceDownloader( val needToRefresh = lastMetadataState.isEmpty || lastMetadataState.get.lastModified.before(lastModifiedTimeInS3) if (!needToRefresh) { + metadataObject.close() lastMetadataState.get.metadata } else { val metadata = ResourceMetadata.readResources(metadataObject.getObjectContent) + metadataObject.close() repoFolder2Metadata(folder) = RepositoryMetadata( folder, lastModifiedTimeInS3,