Browse Source

update semaphore ID

sqlite
ghost 1 year ago
parent
commit
e30466980b
  1. 14
      crawler.php

14
crawler.php

@ -1,8 +1,12 @@ @@ -1,8 +1,12 @@
<?php
$semaphore = sem_get(1);
$semaphore = sem_get(crc32('kvazar-network.crawler_full_node'), 1);
if (false !== sem_acquire($semaphore, 1)) {
if (false === sem_acquire($semaphore, true)) {
echo "database locked by the another process...\n";
exit;
}
require_once(__DIR__ . '/config.php');
require_once(__DIR__ . '/library/sqlite.php');
@ -181,9 +185,3 @@ if (false !== sem_acquire($semaphore, 1)) { @@ -181,9 +185,3 @@ if (false !== sem_acquire($semaphore, 1)) {
echo "scanning completed.\n";
# print_r($response);
}
sem_release($semaphore);
} else {
echo "database locked by the another process...\n";
}

Loading…
Cancel
Save