Properly use "saveDeferred" only in instances where "commit" is called later.
This commit is contained in:
parent
5653dfae87
commit
68b7dee8a9
|
@ -84,7 +84,7 @@ final class ListAction extends AbstractSearchableListAction
|
|||
$item->set($playlistIds);
|
||||
$item->expiresAfter(600);
|
||||
|
||||
$this->psr6Cache->saveDeferred($item);
|
||||
$this->psr6Cache->save($item);
|
||||
}
|
||||
|
||||
return $item->get();
|
||||
|
|
|
@ -130,7 +130,7 @@ final class ListAction extends AbstractSearchableListAction
|
|||
$item->set($ids);
|
||||
$item->expiresAfter(600);
|
||||
|
||||
$this->psr6Cache->saveDeferred($item);
|
||||
$this->psr6Cache->save($item);
|
||||
}
|
||||
|
||||
return $item->get();
|
||||
|
|
|
@ -96,7 +96,7 @@ final class ScheduleAction
|
|||
);
|
||||
$cacheItem->expiresAfter(600);
|
||||
|
||||
$this->psr6Cache->saveDeferred($cacheItem);
|
||||
$this->psr6Cache->save($cacheItem);
|
||||
}
|
||||
|
||||
$events = $cacheItem->get();
|
||||
|
@ -117,7 +117,7 @@ final class ScheduleAction
|
|||
$cacheItem->set($this->scheduleRepo->getUpcomingSchedule($station, $now));
|
||||
$cacheItem->expiresAfter(60);
|
||||
|
||||
$this->psr6Cache->saveDeferred($cacheItem);
|
||||
$this->psr6Cache->save($cacheItem);
|
||||
}
|
||||
|
||||
$events = $cacheItem->get();
|
||||
|
|
|
@ -210,6 +210,9 @@ final class ListenerRepository extends Repository
|
|||
} finally {
|
||||
@unlink($tempCsvPath);
|
||||
}
|
||||
|
||||
$this->deviceDetector->saveCache();
|
||||
$this->ipGeolocation->saveCache();
|
||||
}
|
||||
|
||||
private function batchAddRow(Entity\Station $station, Client $client): array
|
||||
|
|
|
@ -52,4 +52,9 @@ final class DeviceDetector
|
|||
|
||||
return $deviceResult;
|
||||
}
|
||||
|
||||
public function saveCache(): bool
|
||||
{
|
||||
return $this->psr6Cache->commit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ final class OAuthAdapter implements RefreshableTokenProvider
|
|||
}
|
||||
|
||||
$cacheItem->expiresAfter(600);
|
||||
$this->psr6Cache->saveDeferred($cacheItem);
|
||||
$this->psr6Cache->save($cacheItem);
|
||||
}
|
||||
|
||||
return $cacheItem->get();
|
||||
|
|
|
@ -114,4 +114,9 @@ final class IpGeolocation
|
|||
];
|
||||
}
|
||||
}
|
||||
|
||||
public function saveCache(): bool
|
||||
{
|
||||
return $this->psr6Cache->commit();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue