Browse Source

add semaphore namespace prefix

main
ghost 1 year ago
parent
commit
ee074b684a
  1. 7
      src/cli/document/clean.php
  2. 7
      src/cli/document/crawl.php

7
src/cli/document/clean.php

@ -1,7 +1,12 @@
<?php <?php
// Prevent multi-thread execution // Prevent multi-thread execution
$semaphore = sem_get(crc32('yo.cli.document.clean'), 1); $semaphore = sem_get(
crc32(
__DIR__ . '.yo.cli.document.clean'
),
1
);
if (false === sem_acquire($semaphore, true)) if (false === sem_acquire($semaphore, true))
{ {

7
src/cli/document/crawl.php

@ -1,7 +1,12 @@
<?php <?php
// Prevent multi-thread execution // Prevent multi-thread execution
$semaphore = sem_get(crc32('yo.cli.document.crawl'), 1); $semaphore = sem_get(
crc32(
__DIR__ . '.yo.cli.document.crawl'
),
1
);
if (false === sem_acquire($semaphore, true)) if (false === sem_acquire($semaphore, true))
{ {

Loading…
Cancel
Save