Browse Source

lock multi-thread execution

sqliteway
ghost 2 years ago
parent
commit
1485983b3a
  1. 8
      crontab/crawler.php

8
crontab/crawler.php

@ -1,5 +1,13 @@ @@ -1,5 +1,13 @@
<?php
// Lock multi-thread execution
$semaphore = sem_get(crc32('crontab.crawler'), 1);
if (false === sem_acquire($semaphore, true)) {
exit;
}
// Load system dependencies
require_once('../config/app.php');
require_once('../library/curl.php');

Loading…
Cancel
Save