Browse Source

add semaphores namespace

main
ghost 1 year ago
parent
commit
d1b115d11c
  1. 4
      src/crontab/cleaner.php
  2. 4
      src/crontab/crawler.php

4
src/crontab/cleaner.php

@ -1,7 +1,7 @@
<?php <?php
// Stop cleaner on cli running // Stop cleaner on cli running
$semaphore = sem_get(crc32('cli.yggo'), 1); $semaphore = sem_get(crc32('yggo.cli.yggo'), 1);
if (false === sem_acquire($semaphore, true)) { if (false === sem_acquire($semaphore, true)) {
@ -10,7 +10,7 @@ if (false === sem_acquire($semaphore, true)) {
} }
// Lock multi-thread execution // Lock multi-thread execution
$semaphore = sem_get(crc32('crontab.cleaner'), 1); $semaphore = sem_get(crc32('yggo.crontab.cleaner'), 1);
if (false === sem_acquire($semaphore, true)) { if (false === sem_acquire($semaphore, true)) {

4
src/crontab/crawler.php

@ -1,7 +1,7 @@
<?php <?php
// Stop crawler on cli running // Stop crawler on cli running
$semaphore = sem_get(crc32('cli.yggo'), 1); $semaphore = sem_get(crc32('yggo.cli.yggo'), 1);
if (false === sem_acquire($semaphore, true)) { if (false === sem_acquire($semaphore, true)) {
@ -10,7 +10,7 @@ if (false === sem_acquire($semaphore, true)) {
} }
// Lock multi-thread execution // Lock multi-thread execution
$semaphore = sem_get(crc32('crontab.crawler'), 1); $semaphore = sem_get(crc32('yggo.crontab.crawler'), 1);
if (false === sem_acquire($semaphore, true)) { if (false === sem_acquire($semaphore, true)) {

Loading…
Cancel
Save