update semaphore ID

This commit is contained in:
ghost 2023-07-07 11:48:38 +03:00
parent e0831b59f5
commit bfc73fd8bd

View File

@ -1,8 +1,12 @@
<?php
$semaphore = sem_get(1);
$semaphore = sem_get(crc32('kvazar-network.crawler_api_node'), 1);
if (false !== sem_acquire($semaphore, 1)) {
if (false === sem_acquire($semaphore, true)) {
echo "database locked by the another process..." . PHP_EOL;
exit;
}
require_once(__DIR__ . '/config.php');
require_once(__DIR__ . '/library/sqlite.php');
@ -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";
}