Skip to content

Commit f3ba8b1

Browse files
authored
Merge pull request #11 from yanis-git/main
feat(isolated): add isolation run when we deploy in multiple instance…
2 parents 69f5b1c + 6b6bb95 commit f3ba8b1

File tree

5 files changed

+7
-68
lines changed

5 files changed

+7
-68
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.phpunit.result.cache
2+
vendor
3+
.idea

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ php artisan operations:process // process all new operation fi
5252
php artisan operations:process --sync // force syncronously execution
5353
php artisan operations:process --async // force asyncronously execution
5454
php artisan operations:process --test // dont flag operations as processed
55+
php artisan operations:process --isolated // Do not run the command if another instance of the command is already running
5556

5657
php artisan operations:process --queue=<name> // force queue, that the job will be dispatched to
5758
php artisan operations:process --tag=<tagname> // only process operations, that have the given tag

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"homepage": "https://github.com/timokoerber/laravel-one-time-operations",
2121
"require": {
2222
"php": "^8.0",
23+
"illuminate/contracts": "^9.0|^10.0",
2324
"illuminate/support": "^9.0|^10.0"
2425
},
2526
"require-dev": {

composer.lock

Lines changed: 1 addition & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Commands/OneTimeOperationsProcessCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
namespace TimoKoerber\LaravelOneTimeOperations\Commands;
44

5+
use Illuminate\Contracts\Console\Isolatable;
56
use Illuminate\Support\Arr;
67
use Illuminate\Support\Collection;
78
use TimoKoerber\LaravelOneTimeOperations\Jobs\OneTimeOperationProcessJob;
89
use TimoKoerber\LaravelOneTimeOperations\Models\Operation;
910
use TimoKoerber\LaravelOneTimeOperations\OneTimeOperationFile;
1011
use TimoKoerber\LaravelOneTimeOperations\OneTimeOperationManager;
1112

12-
class OneTimeOperationsProcessCommand extends OneTimeOperationsCommand
13+
class OneTimeOperationsProcessCommand extends OneTimeOperationsCommand implements Isolatable
1314
{
1415
protected $signature = 'operations:process
1516
{name? : Name of specific operation}

0 commit comments

Comments
 (0)