Skip to content

Commit

Permalink
fix: ignore saves when only date is in save map
Browse files Browse the repository at this point in the history
  • Loading branch information
QuadStingray committed May 12, 2023
1 parent 2e26826 commit 2d83fb2
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ class MongoStepMeterRegistry(config: MongoRegistryConfig, threadFactory: NamedTh
.map(meter => getConventionName(meter.getId) -> convertMeterToMap(meter))
.toMap
.filter(_._2.nonEmpty) ++ Map("date" -> new Date())
val result = config.mongoDAO.insertOne(documentFromScalaMap(metrics)).result(saveWait.toSeconds.toInt)
result.wasAcknowledged()
if (metrics.size > 1) {
val result = config.mongoDAO.insertOne(documentFromScalaMap(metrics)).result(saveWait.toSeconds.toInt)
result.wasAcknowledged()
}
}

override def getBaseTimeUnit: TimeUnit = TimeUnit.SECONDS
Expand Down

0 comments on commit 2d83fb2

Please sign in to comment.