Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/tests(#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbnetley committed Jul 14, 2020
2 parents 599b4d9 + 976e7bb commit 1e9b22d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version = 1.3.10
sbt.version = 1.3.13
4 changes: 2 additions & 2 deletions src/main/scala/util/dataBuilder/Processing.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/scala/util/file/FileHelper.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

Expand All @@ -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)
}
}

Expand Down

0 comments on commit 1e9b22d

Please sign in to comment.