mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2024-12-18 17:10:29 +03:00
fix(file_cache): if write failure, produce log record instead of exception (#4352)
This commit is contained in:
parent
88ccc6067c
commit
6a81fc0f51
1 changed files with 6 additions and 3 deletions
|
@ -54,10 +54,13 @@ class FileCache implements CacheInterface
|
||||||
];
|
];
|
||||||
$cacheFile = $this->createCacheFile($key);
|
$cacheFile = $this->createCacheFile($key);
|
||||||
$bytes = file_put_contents($cacheFile, serialize($item));
|
$bytes = file_put_contents($cacheFile, serialize($item));
|
||||||
// todo: Consider tightening the permissions of the created file. It usually allow others to read, depending on umask
|
|
||||||
|
// TODO: Consider tightening the permissions of the created file.
|
||||||
|
// It usually allow others to read, depending on umask
|
||||||
|
|
||||||
if ($bytes === false) {
|
if ($bytes === false) {
|
||||||
// Consider just logging the error here
|
// Typically means no disk space remaining
|
||||||
throw new \Exception(sprintf('Failed to write to: %s', $cacheFile));
|
$this->logger->warning(sprintf('Failed to write to: %s', $cacheFile));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue