Compare commits
2 Commits
72486a54f7
...
91ceafe75b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
91ceafe75b | ||
|
|
057cdddff6 |
@@ -39,7 +39,8 @@ public class AdvertisingController {
|
||||
log.info("getNextAdvertising");
|
||||
Optional<SelectedAdvertisingDto> selected = advertisingSelectionService.selectAdvertising(authentication, sessionId, request);
|
||||
if (selected.isEmpty()) {
|
||||
log.warn("failed get advertising");
|
||||
// Нормальная ситуация (нет активных реклам / кулдаун / кап) — не ошибка
|
||||
log.debug("No advertising to show, returning 204");
|
||||
return ResponseEntity.noContent().build();
|
||||
}
|
||||
|
||||
|
||||
@@ -36,13 +36,13 @@ public class AdvertisingSelectionService {
|
||||
String resolvedSessionId = sessionId != null ? sessionId : request.getSession(true).getId();
|
||||
|
||||
if (!frequencyService.isSessionCooldownPassed(resolvedSessionId)) {
|
||||
log.warn("isSessionCooldownPassed by {} resolvedSessionId is empty", resolvedSessionId);
|
||||
log.debug("Session cooldown not passed for sessionId={}", resolvedSessionId);
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
List<Advertising> eligible = adRepository.findEligibleAds(LocalDateTime.now());
|
||||
if (eligible.isEmpty()) {
|
||||
log.warn("findEligibleAds is empty");
|
||||
log.debug("No eligible ads to show");
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user