Don't compute promotions twice

pull/9372/head
Benedikt Werner 2021-07-09 01:12:20 +02:00
parent a4d2b57a78
commit 1ddec0a750
No known key found for this signature in database
GPG Key ID: 1DBFF0F8E9E121EB
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@ final class PromotionApi(domain: NetDomain) {
def save(user: User, text: String): Unit = {
val promotions = extract(text)
if (promotions.nonEmpty) cache.put(user.id, ~cache.getIfPresent(user.id) ++ extract(text))
if (promotions.nonEmpty) cache.put(user.id, ~cache.getIfPresent(user.id) ++ promotions)
}
private type Id = String