fix snap fs init

This commit is contained in:
ghost 2023-07-29 19:53:31 +03:00
parent 6eb45fdad2
commit 79d07dd1a5

View File

@ -669,14 +669,18 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND
$crc32data = crc32($content); $crc32data = crc32($content);
$snapTime = time();
$snapPath = chunk_split($queueHostPage->hostPageId, 1, '/');
$snapTmp = __DIR__ . '/../storage/tmp/snap/hp/' . $snapPath . $snapTime . '.zip';
@mkdir(__DIR__ . '/../storage/tmp/snap/hp/' . $snapPath, 0755, true);
// Create not duplicated data snaps only, even newer by time added // Create not duplicated data snaps only, even newer by time added
if (!$db->findHostPageSnap($queueHostPage->hostPageId, $crc32data)) { if ($hostPageSnap = $db->findHostPageSnap($queueHostPage->hostPageId, $crc32data)) {
$snapTime = time(); $hostPageSnapId = $hostPageSnap->hostPageSnapId;
$snapPath = chunk_split($queueHostPage->hostPageId, 1, '/');
$snapTmp = __DIR__ . '/../storage/tmp/snap/hp/' . $snapPath . $snapTime . '.zip'; } else {
@mkdir(__DIR__ . '/../storage/tmp/snap/hp/' . $snapPath, 0755, true);
// Create new ZIP container // Create new ZIP container
$zip = new ZipArchive(); $zip = new ZipArchive();