Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Oct 18, 2019
1 parent d0bd591 commit 1532f9c
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Jobs/StopMonitoringTag.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,14 @@ public function handle(JobRepository $jobs, TagRepository $tags)
{
$tags->stopMonitoring($this->tag);

$tagJobs = $tags->paginate($this->tag);
$monitored = $tags->paginate($this->tag);

while (count($tagJobs) !== 0) {
$jobs->deleteMonitored($tagJobs);
while (count($monitored) > 0) {
$jobs->deleteMonitored($monitored);

$offset = array_keys($tagJobs)[count($tagJobs) - 1] + 1;
$tagJobs = $tags->paginate($this->tag, $offset);
$offset = array_keys($monitored)[count($monitored) - 1] + 1;

$monitored = $tags->paginate($this->tag, $offset);
}

$tags->forget($this->tag);
Expand Down

0 comments on commit 1532f9c

Please sign in to comment.