Skip to content

Commit a4c54e8

Browse files
committed
Updated readme with verboseLockFile config
1 parent 7839b9f commit a4c54e8

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ You can pass to the Scheduler constructor an array with your global config for t
119119
```php
120120
...
121121
$config = [
122-
'emailFrom' => '[email protected]'
122+
'emailFrom' => '[email protected]',
123123
];
124124

125125
$scheduler = new Scheduler($config);
@@ -130,10 +130,30 @@ $scheduler = new Scheduler($config);
130130

131131
```php
132132
$scheduler = new Scheduler([
133-
'tempDir' => 'my/custom/temp/dir'
133+
'tempDir' => 'my/custom/temp/dir',
134134
])
135135
```
136136

137+
- Set your timezone. Default to `Europe/Dublin`.
138+
139+
```php
140+
$scheduler = new Scheduler([
141+
'timezone' => 'Europe/Dublin',
142+
])
143+
```
144+
145+
- Create verbose lock files. This config allows you to define an identifier for closures that shouldn't overlap. The standard behaviour is to generate an hash of the closure and use that hash to create the lock file. With this option, the generated lock file will be the `md5` hash of your command id. [Read more](https://github.com/peppeocchi/php-cron-scheduler/pull/10)
146+
147+
```php
148+
$scheduler = new Scheduler([
149+
'verboseLockFile' => true,
150+
]);
151+
152+
$job = $scheduler->call(function () {
153+
return true;
154+
}, [], 'myCommandId');
155+
```
156+
137157
### Jobs execution order
138158
The jobs that are due to run are being ordered by their execution: jobs that can run in **background** will be executed **first**
139159

0 commit comments

Comments
 (0)