Skip to content

Commit

Permalink
refactor(DeeplyReadAgent): better logging (#27019)
Browse files Browse the repository at this point in the history
The current formatting of keys is hard to parse,
and it is helpful to know the size of the new map
  • Loading branch information
mxdvl committed Apr 5, 2024
1 parent 73665b6 commit 96ce14e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion common/app/agents/DeeplyReadAgent.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ class DeeplyReadAgent(contentApiClient: ContentApiClient, ophanApi: OphanApi) ex
} yield log.info(s"Deeply Read in ${edition.displayName}, ${list.size} items: ${list.map(_.url).toString()}")

val mapWithTenItems = map.filter { case (_, list) => list.size == 10 }
log.info(s"Updating the followings keys: ${mapWithTenItems.keys.toString()}")
log.info(
s"Updating the following ${mapWithTenItems.size} editions: ${mapWithTenItems.keys.map(_.id).toList.sorted.toString()}",
)

deeplyReadItems.alter(deeplyReadItems.get() ++ mapWithTenItems)
})
Expand Down

0 comments on commit 96ce14e

Please sign in to comment.