Skip to content

Commit 4f0ae3c

Browse files
authored
Merge pull request #35 from OnitaAndrei/issue-31
added lock files documentation
2 parents efdd971 + a6b72d9 commit 4f0ae3c

File tree

3 files changed

+20
-5
lines changed

3 files changed

+20
-5
lines changed

docs/book/v3/lock-files.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Lock Files
2+
3+
When a command starts running, a lock file is created for that command.
4+
The lock file ensures that the same command would not run before the previous one is done.
5+
If a command was force stopped, locate the lock file in the configured directory and delete it to refresh the command.
6+
7+
## Configuration
8+
9+
Inside `config/autoload/cli.global.php` under the `FileLockerInterface::class` key the file locker can be disabled and the location of the lock files can be changed
10+
11+
FileLockerInterface::class => [
12+
'enabled' => true,
13+
'dirPath' => getcwd() . '/data/lock',
14+
],
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Setting up as cronjob
22

33
```text
4-
* * * * * /opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q
4+
* * * * * php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q
55
```
66

77
or
88

99
```text
10-
* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && /opt/plesk/php/7.4/bin/php ./cli.php demo:command -q
10+
* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && php ./cli.php demo:command -q
1111
```
1212

13-
Adapt the command to your specifications by replacing **7.4** with your PHP version and **example.com** with your domain name.
13+
Adapt the command to your specifications by replacing **example.com** with your domain name.
1414

1515
Note the **-q** (or **--quiet**) option at the end of the command - it serves as a flag to inform the Application that no output should be returned (unless it's an error).

mkdocs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ extra:
88
nav:
99
- Home: index.md
1010
- v3:
11-
- Configuration: v3/configuration.md
1211
- Installation: v3/installation.md
13-
- "Setting Up As Cronjob": v3/setting-up-as-cronjob.md
12+
- Configuration: v3/configuration.md
13+
- "Lock Files": v3/lock-files.md
1414
- Testing: v3/testing.md
1515
- Usage: v3/usage.md
16+
- "Setting Up As Cronjob": v3/setting-up-as-cronjob.md
1617
site_name: dot-cli
1718
site_description: "DotKernel's component to build console applications"
1819
repo_url: "https://github.com/dotkernel/dot-cli"

0 commit comments

Comments
 (0)