mirror of
https://github.com/unraid/api.git
synced 2026-01-06 08:39:54 -06:00
Fix bug in flash backup rate limiter (#880)
Don't try to read from an empty file
This commit is contained in:
@@ -126,7 +126,7 @@ function set_git_config($name, $value) {
|
||||
|
||||
function readFromFile($file): string {
|
||||
$text = "";
|
||||
if (file_exists($file)) {
|
||||
if (file_exists($file) && filesize($file) > 0) {
|
||||
$fp = fopen($file,"r");
|
||||
if (flock($fp, LOCK_EX)) {
|
||||
$text = fread($fp, filesize($file));
|
||||
|
||||
Reference in New Issue
Block a user