Skip to content

Commit

Permalink
Merge pull request #47 from hove-io/bo-3258
Browse files Browse the repository at this point in the history
[BO-3258] Avoid error 500 when there is an error getting publication date
  • Loading branch information
Msaglier authored Mar 26, 2024
2 parents 6b566a4 + f766417 commit 9ac53c8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Cache/Navitia.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ private function checkPublicationDate(): void
if ($cacheItem->isHit()) {
$publicationDateInCache = $cacheItem->get();
}

$currentPublicationDate = $this->getPublicationDate();

if ($currentPublicationDate !== null && $currentPublicationDate !== $publicationDateInCache) {
Expand Down Expand Up @@ -127,7 +128,7 @@ public function setCacheItem(string $cacheKey, $data): void
$this->cache->save($cacheItem);
}

private function getPublicationDate(): string
private function getPublicationDate(): ?string
{
try {
$url = $this->urlApi.'coverage/'.$this->coverage.'/'.self::PUBLICATION_DATE_API;
Expand Down

0 comments on commit 9ac53c8

Please sign in to comment.