Don't compute promotions twice
parent
a4d2b57a78
commit
1ddec0a750
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue