From 9e974a5faffc5491ad06a284378add603c969c5b Mon Sep 17 00:00:00 2001 From: Andrei Onita Date: Thu, 16 May 2024 14:42:21 +0300 Subject: [PATCH 1/2] added lock files documentation --- docs/book/v3/lock-files.md | 14 ++++++++++++++ docs/book/v3/setting-up-as-cronjob.md | 6 +++--- mkdocs.yml | 5 +++-- 3 files changed, 20 insertions(+), 5 deletions(-) create mode 100644 docs/book/v3/lock-files.md diff --git a/docs/book/v3/lock-files.md b/docs/book/v3/lock-files.md new file mode 100644 index 0000000..b4831d7 --- /dev/null +++ b/docs/book/v3/lock-files.md @@ -0,0 +1,14 @@ +# Lock Files + +When a command starts running, a lock file is created for that command. +The lock file ensures that the same command would not run before the previous one is done. +If a command was force stopped, locate the lock file in the configured directory and delete it to refresh the command. + +## Configuration + +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 + + FileLockerInterface::class => [ + 'enabled' => true, + 'dirPath' => getcwd() . '/data/lock', + ], \ No newline at end of file diff --git a/docs/book/v3/setting-up-as-cronjob.md b/docs/book/v3/setting-up-as-cronjob.md index be58f78..5312129 100644 --- a/docs/book/v3/setting-up-as-cronjob.md +++ b/docs/book/v3/setting-up-as-cronjob.md @@ -1,15 +1,15 @@ # Setting up as cronjob ```text -* * * * * /opt/plesk/php/7.4/bin/php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q +* * * * * php /var/www/vhosts/example.com/httpdocs/bin/cli.php demo:command -q ``` or ```text -* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && /opt/plesk/php/7.4/bin/php ./cli.php demo:command -q +* * * * * cd /var/www/vhosts/example.com/httpdocs/bin && php ./cli.php demo:command -q ``` -Adapt the command to your specifications by replacing **7.4** with your PHP version and **example.com** with your domain name. +Adapt the command to your specifications by replacing **example.com** with your domain name. 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). diff --git a/mkdocs.yml b/mkdocs.yml index 3ebd215..4c5cc31 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,11 +8,12 @@ extra: nav: - Home: index.md - v3: - - Configuration: v3/configuration.md - Installation: v3/installation.md - - "Setting Up As Cronjob": v3/setting-up-as-cronjob.md + - Configuration: v3/configuration.md + - "Lock Files": v3/lock-files.md - Testing: v3/testing.md - Usage: v3/usage.md + - "Setting Up As Cronjob": v3/setting-up-as-cronjob.md site_name: dot-cli site_description: "DotKernel's component to build console applications" repo_url: "https://github.com/dotkernel/dot-cli" From a6b72d99038c99c05f568a09346f74f3ffefe2ad Mon Sep 17 00:00:00 2001 From: Andrei Onita Date: Thu, 16 May 2024 14:48:26 +0300 Subject: [PATCH 2/2] new line added to lock-files.md --- docs/book/v3/lock-files.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/book/v3/lock-files.md b/docs/book/v3/lock-files.md index b4831d7..a716fd9 100644 --- a/docs/book/v3/lock-files.md +++ b/docs/book/v3/lock-files.md @@ -11,4 +11,4 @@ Inside `config/autoload/cli.global.php` under the `FileLockerInterface::class` k FileLockerInterface::class => [ 'enabled' => true, 'dirPath' => getcwd() . '/data/lock', - ], \ No newline at end of file + ],