Browse Source

fix quota check condition

main
ghost 2 years ago
parent
commit
5936fa9a30
  1. 14
      crontab/crawler.php

14
crontab/crawler.php

@ -9,13 +9,6 @@ if (false === sem_acquire($semaphore, true)) {
exit; exit;
} }
// Check disk quota
if (CRAWL_STOP_DISK_QUOTA_MB_LEFT > disk_free_space('/') / 1000000) {
echo 'Disk quota reached.' . PHP_EOL;
exit;
}
// Load system dependencies // Load system dependencies
require_once('../config/app.php'); require_once('../config/app.php');
require_once('../library/curl.php'); require_once('../library/curl.php');
@ -24,6 +17,13 @@ require_once('../library/filter.php');
require_once('../library/parser.php'); require_once('../library/parser.php');
require_once('../library/mysql.php'); require_once('../library/mysql.php');
// Check disk quota
if (CRAWL_STOP_DISK_QUOTA_MB_LEFT > disk_free_space('/') / 1000000) {
echo 'Disk quota reached.' . PHP_EOL;
exit;
}
// Debug // Debug
$timeStart = microtime(true); $timeStart = microtime(true);

Loading…
Cancel
Save