Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
edalzell committed Jan 7, 2025
1 parent abaa0c2 commit fb9cfd5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Git/CommitJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\Middleware\WithoutOverlapping;
use Statamic\Facades\Git;

class CommitJob implements ShouldQueue
Expand All @@ -15,9 +16,7 @@ class CommitJob implements ShouldQueue
/**
* Create a new job instance.
*/
public function __construct(public $message = null, public $committer = null)
{
}
public function __construct(public $message = null, public $committer = null) {}

/**
* Execute the job.
Expand All @@ -26,4 +25,12 @@ public function handle()
{
Git::as($this->committer)->commit($this->message);
}

/**
* @return array<int, object>
*/
public function middleware(): array
{
return [(new WithoutOverlapping('git'))->expireAfter(60)->releaseAfter(30)];
}
}

0 comments on commit fb9cfd5

Please sign in to comment.