Merge pull request #3162 from annando/bugfix-spooling

Bugfix: Only delete spool files that are spool files
This commit is contained in:
Tobias Diekershoff 2017-02-15 07:29:38 +01:00 committed by GitHub
commit 78715c8671

View file

@ -35,7 +35,13 @@ function spool_post_run($argv, $argc) {
continue; continue;
} }
$arr = json_decode(file_get_contents($fullfile), true); $arr = json_decode(file_get_contents($fullfile), true);
if (!is_array($arr)) {
continue;
}
$result = item_store($arr); $result = item_store($arr);
if ($result == 0) {
continue;
}
logger("Spool file ".$file." stored: ".$result, LOGGER_DEBUG); logger("Spool file ".$file." stored: ".$result, LOGGER_DEBUG);
unlink($fullfile); unlink($fullfile);
} }