diff --git a/src/index.php b/src/index.php index 8d73697..cb9878e 100644 --- a/src/index.php +++ b/src/index.php @@ -12,6 +12,11 @@ define('CONFIG', __DIR__ . '/../config.json'); // Load composer dependencies require_once __DIR__ . '/../vendor/autoload.php'; +// Prevent multi-thread execution +$semaphore = sem_get( + crc32(__FILE__), 1 +); + if (false === sem_acquire($semaphore, true)) { exit( @@ -19,11 +24,6 @@ if (false === sem_acquire($semaphore, true)) ); } -// Prevent multi-thread execution -$semaphore = sem_get( - crc32(__FILE__), 1 -); - // Init config if (!file_exists(CONFIG)) {