Skip to content

Instantly share code, notes, and snippets.

@profitcore
Last active January 17, 2017 18:04
Show Gist options
  • Save profitcore/8a4ef9738f6748d23e8f53a945235a25 to your computer and use it in GitHub Desktop.
Save profitcore/8a4ef9738f6748d23e8f53a945235a25 to your computer and use it in GitHub Desktop.
<?php
$file='/tmp/parser_status.lock';
if(!flock($lock_file = fopen($file, 'w'), LOCK_EX | LOCK_NB))
die("Already runninng\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment