Skip to content

Commit 05cf546

Browse files
committed
Merge branch 'release/3.0.0' into feature/3x-github-packages
2 parents 75bf9ba + 85fa28f commit 05cf546

22 files changed

Lines changed: 579 additions & 322 deletions

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ REDIS_CACHE_DSN=redis://redis:6379/0
6464
###> Http Client ###
6565
HTTP_CLIENT_TIMEOUT=5
6666
HTTP_CLIENT_MAX_DURATION=30
67+
HTTP_CLIENT_LOG_LEVEL=error
6768
###< Http Client ###
6869

6970
###> App ###

config/packages/cache.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ framework:
1919

2020
feed.without.expire.cache:
2121
adapter: cache.adapter.redis
22+
# Safety net (24 hours) — code sets explicit TTL on items,
23+
# but this ensures orphaned keys don't persist indefinitely.
24+
default_lifetime: 86400
2225

2326
# Creates a "calendar.api.cache" service
2427
calendar.api.cache:

config/packages/monolog.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
monolog:
2+
channels: ['app_http']

config/packages/prod/monolog.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ monolog:
1111
path: php://stderr
1212
level: debug
1313
formatter: monolog.formatter.json
14+
app_http:
15+
type: stream
16+
path: php://stderr
17+
level: info
18+
channels: ['app_http']
19+
formatter: monolog.formatter.json
1420
console:
1521
type: console
1622
process_psr_3_messages: false

config/services.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ services:
4848
- '../src/Kernel.php'
4949
- '../src/Tests/'
5050

51+
App\HttpClient\LoggingHttpClient:
52+
decorates: http_client
53+
arguments:
54+
$client: '@.inner'
55+
$logger: '@monolog.logger.app_http'
56+
$logLevel: '%env(string:HTTP_CLIENT_LOG_LEVEL)%'
57+
5158
#### App Scope below ###
5259

5360
Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface: '@Lexik\Bundle\JWTAuthenticationBundle\Security\Http\Authentication\AuthenticationFailureHandler'

docker-compose.override.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ services:
77

88
redis:
99
image: "redis:6"
10+
command: redis-server --maxmemory 128mb --maxmemory-policy allkeys-lru
1011
networks:
1112
- app
1213
ports:

docs/v2-changelogs/api.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,28 @@ All notable changes to this project will be documented in this file.
44

55
## [Unreleased]
66

7+
- [#385](https://github.com/os2display/display-api-service/pull/385)
8+
- Replaced PSR-6 caching with Symfony `CacheInterface::get()` in
9+
`FeedService` and `EventDatabaseApiV2FeedType` for stampede prevention.
10+
- Renamed HTTP client logging channel from `http_client` to `app_http` to separate from Symfony's built-in logging.
11+
- Injected container-managed `HttpClientInterface` into `RssFeedType` for logging coverage.
12+
- Improved `CalendarApiFeedType` error logging with feed ID, tenant key, and exception context.
13+
- Added default TTL (24h) to `feed.without.expire.cache` pool as safety net for orphaned keys.
14+
- Added Redis `maxmemory` and `allkeys-lru` eviction policy to dev config.
15+
- Added unit tests for `LoggingHttpClient`.
16+
- [#383](https://github.com/os2display/display-api-service/pull/383)
17+
- Fixed `testUnlinkSlide` using same slide for both lookups, causing "Relation not found" failure.
18+
- [#382](https://github.com/os2display/display-api-service/pull/382)
19+
- Fixed cache stampede in CalendarApiFeedType by using Symfony CacheInterface with stampede prevention.
20+
- Added HTTP client logging decorator with dedicated `http_client` Monolog channel.
21+
- Added configurable `HTTP_CLIENT_LOG_LEVEL` env var (defaults to `error`).
22+
- Migrated Brnd and Colibo ApiClients to use injected HttpClient for logging coverage.
723
- [#379](https://github.com/os2display/display-api-service/pull/379)
824
- Ensure the http client has a default time out setting. Make it configurable in env.
925
- [#376](https://github.com/os2display/display-api-service/pull/376)
1026
- Add prod override for cache.app to use Redis in production.
27+
- [#386](https://github.com/os2display/display-api-service/pull/386)
28+
- Add better cache handling when getData throws errors.
1129

1230
## [2.6.1] - 2026-03-10
1331

src/Feed/BrndFeedType.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function getData(Feed $feed): array
7878

7979
$bookings = $this->apiClient->getInfomonitorBookingsDetails($feedSource, $sportCenterId);
8080

81-
$result['bookings'] = array_reduce($bookings, function (array $carry, array $booking): array {
81+
return array_reduce($bookings, function (array $carry, array $booking): array {
8282
$parsedBooking = $this->parseBrndBooking($booking);
8383

8484
// Validate that booking has required fields
@@ -90,11 +90,9 @@ public function getData(Feed $feed): array
9090
}, []);
9191
} catch (\Throwable $throwable) {
9292
$this->logger->error($throwable->getMessage());
93-
// Silently catch all exceptions and return empty result
94-
// $result is already initialized with empty bookings array
95-
}
9693

97-
return $result;
94+
throw $throwable;
95+
}
9896
}
9997

10098
private function parseBrndBooking(array $booking): array

0 commit comments

Comments
 (0)