diff --git a/build.sbt b/build.sbt index a27902c..e188458 100644 --- a/build.sbt +++ b/build.sbt @@ -4,7 +4,7 @@ version := "0.1" libraryDependencies ++= { val scalaTest: Seq[ModuleID] = { - val version = "3.1.2" + val version = "3.2.0" Seq( "org.scalactic" %% "scalactic" % version, "org.scalatest" % "scalatest_2.13" % version % "test" @@ -13,12 +13,12 @@ libraryDependencies ++= { Seq( "org.mongodb.scala" %% "mongo-scala-driver" % "2.9.0", - "io.monix" %% "monix" % "3.2.1", + "io.monix" %% "monix" % "3.2.2", "org.typelevel" %% "cats-core" % "2.1.1", "ch.qos.logback" % "logback-classic" % "1.2.3", "com.typesafe.scala-logging" %% "scala-logging" % "3.9.2", "com.typesafe" % "config" % "1.4.0", - "com.beachape" %% "enumeratum" % "1.6.0", + "com.beachape" %% "enumeratum" % "1.6.1", ) ++ scalaTest } diff --git a/project/build.properties b/project/build.properties index f37b0aa..302b6be 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.3.10 \ No newline at end of file +sbt.version = 1.3.13 \ No newline at end of file diff --git a/src/main/scala/util/dataBuilder/Processing.scala b/src/main/scala/util/dataBuilder/Processing.scala index a8e5013..f5247c8 100644 --- a/src/main/scala/util/dataBuilder/Processing.scala +++ b/src/main/scala/util/dataBuilder/Processing.scala @@ -8,7 +8,7 @@ import monix.eval.Task import org.bson.Document import scala.concurrent.Await -import scala.concurrent.duration.Duration +import scala.concurrent.duration._ import util.ErrorHandler._ import util.models.OrderedFile import org.mongodb.scala.MongoDatabase @@ -35,7 +35,7 @@ object Processing { dbInsert <- EitherT.rightT[Task, Exception](database.getCollection[Document](collectionName).insertMany(documentResult)) } yield { println(s"Inserting into db: $dbInsert") - Await.result(dbInsert.toFuture(), Duration.Inf) + Await.result(dbInsert.toFuture(), 30.seconds) println(s"Done processing file ${orderedFile.index + 1}") }).value } diff --git a/src/main/scala/util/file/FileHelper.scala b/src/main/scala/util/file/FileHelper.scala index 8b78c4c..7dfa8d1 100644 --- a/src/main/scala/util/file/FileHelper.scala +++ b/src/main/scala/util/file/FileHelper.scala @@ -23,8 +23,7 @@ object FileHelper { Right(dir.files.filter(file => okFileExtensions.contains(file.extension)).toList) }.onErrorHandle { e => val message = s"Could not read files from path: ${e.getMessage}" - log.error(message, e) - Left(new Exception(message)) + errorL(message) } } @@ -42,8 +41,7 @@ object FileHelper { } catch { case e: Exception => val message = "Failed to extract csv files: "+ e.getMessage - log.error(message) - Left(new Exception(message, e)) + errorL(message) } }