Skip to content

Commit

Permalink
Updated default cron lock dir path
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavsingh committed Mar 18, 2011
1 parent 3ce2ff3 commit 01e8d44
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ cronHelper.php is a utility class to avoid cron job overlap

## Usage

// edit cronHelper.ini as required
require 'cronHelper.php';

if(($pid = cronHelper::lock()) !== FALSE) {
// write your cron job code here

// unlock once done with the job
cronHelper::unlock();
}
}
4 changes: 2 additions & 2 deletions cronHelper.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

// directory path to be used for cron locks
define('LOCK_DIR', '/path/to/lock/directory/');
define('LOCK_DIR', '/tmp/');

// suffic of cron lock files
define('LOCK_SUFFIX', '.lock');

?>
?>
3 changes: 1 addition & 2 deletions cronHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
* @link http://abhinavsingh.com/blog/2009/12/how-to-use-locks-in-php-cron-jobs-to-avoid-cron-overlaps/
*/

define('LOCK_DIR', '/path/to/lock/directory/');
define('LOCK_SUFFIX', '.lock');
require_once 'cronHelper.ini';

/**
* cronHelper is helpful in avoiding cron job overlaps
Expand Down

0 comments on commit 01e8d44

Please sign in to comment.