lock multi-thread execution

This commit is contained in:
ghost 2023-04-02 00:27:33 +03:00
parent c9be4d54cc
commit 1485983b3a

View File

@ -1,5 +1,13 @@
<?php <?php
// Lock multi-thread execution
$semaphore = sem_get(crc32('crontab.crawler'), 1);
if (false === sem_acquire($semaphore, true)) {
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');