fix size propagation for new files

remotes/origin/s3patch
Robin Appelman 2016-02-29 17:31:01 +07:00
parent 52d217d775
commit 8c700cc99d
1 changed files with 5 additions and 1 deletions

@ -198,7 +198,11 @@ class Scanner extends BasicEmitter implements IScanner {
if (!empty($newData)) {
$data['fileid'] = $this->addToCache($file, $newData, $fileId);
}
$data['oldSize'] = $cacheData['size'];
if (isset($cacheData['size'])) {
$data['oldSize'] = $cacheData['size'];
} else {
$data['oldSize'] = 0;
}
// post-emit only if it was a file. By that we avoid counting/treating folders as files
if ($data['mimetype'] !== 'httpd/unix-directory') {