mirror of
https://github.com/kvazar-network/crawler.git
synced 2025-08-26 14:32:02 +00:00
fix semaphore construction
This commit is contained in:
parent
f6cb2a4191
commit
f2a0c3a94e
@ -12,6 +12,11 @@ define('CONFIG', __DIR__ . '/../config.json');
|
|||||||
// Load composer dependencies
|
// Load composer dependencies
|
||||||
require_once __DIR__ . '/../vendor/autoload.php';
|
require_once __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
|
// Prevent multi-thread execution
|
||||||
|
$semaphore = sem_get(
|
||||||
|
crc32(__FILE__), 1
|
||||||
|
);
|
||||||
|
|
||||||
if (false === sem_acquire($semaphore, true))
|
if (false === sem_acquire($semaphore, true))
|
||||||
{
|
{
|
||||||
exit(
|
exit(
|
||||||
@ -19,11 +24,6 @@ if (false === sem_acquire($semaphore, true))
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prevent multi-thread execution
|
|
||||||
$semaphore = sem_get(
|
|
||||||
crc32(__FILE__), 1
|
|
||||||
);
|
|
||||||
|
|
||||||
// Init config
|
// Init config
|
||||||
if (!file_exists(CONFIG))
|
if (!file_exists(CONFIG))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user