Browse Source

fix snap crc32name index

main
ghost 1 year ago
parent
commit
6eb45fdad2
  1. 12
      crontab/cleaner.php
  2. 9
      crontab/crawler.php

12
crontab/cleaner.php

@ -96,10 +96,10 @@ try { @@ -96,10 +96,10 @@ try {
// Delete snap files
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
foreach ($storages as $storage) {
foreach ($storages as $i => $storage) {
// Generate storage id
$crc32name = crc32(sprintf('%s.%s', $name, $snapStorageIndex));
$crc32name = crc32(sprintf('%s.%s', $name, $i));
switch ($name) {
@ -162,10 +162,10 @@ try { @@ -162,10 +162,10 @@ try {
// Delete snap files
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
foreach ($storages as $storage) {
foreach ($storages as $i => $storage) {
// Generate storage id
$crc32name = crc32(sprintf('%s.%s', $name, $snapStorageIndex));
$crc32name = crc32(sprintf('%s.%s', $name, $i));
switch ($name) {
@ -284,10 +284,10 @@ try { @@ -284,10 +284,10 @@ try {
// Delete snap files
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
foreach ($storages as $storage) {
foreach ($storages as $i => $storage) {
// Generate storage id
$crc32name = crc32(sprintf('%s.%s', $name, $snapStorageIndex));
$crc32name = crc32(sprintf('%s.%s', $name, $i));
switch ($name) {

9
crontab/crawler.php

@ -708,17 +708,12 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND @@ -708,17 +708,12 @@ foreach ($db->getHostPageCrawlQueue(CRAWL_PAGE_LIMIT, time() - CRAWL_PAGE_SECOND
}
// Copy files to each storage
$snapStorageIndex = 0;
foreach (json_decode(SNAP_STORAGE) as $name => $storages) {
foreach ($storages as $storage) {
$snapStorageIndex++;
foreach ($storages as $i => $storage) {
// Generate storage id
$crc32name = crc32(sprintf('%s.%s', $name, $snapStorageIndex));
$crc32name = crc32(sprintf('%s.%s', $name, $i));
switch ($name) {

Loading…
Cancel
Save