Skip to content

Commit

Permalink
[11.x] Fix withoutOverlapping for grouped scheduled closures (#53680)
Browse files Browse the repository at this point in the history
* fix

* formatting

---------

Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
istiak-tridip and taylorotwell authored Nov 27, 2024
1 parent b1f07ed commit 285d4b7
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 deletions.
31 changes: 0 additions & 31 deletions src/Illuminate/Console/Scheduling/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,6 @@ class Event
*/
protected $afterCallbacks = [];

/**
* The human readable description of the event.
*
* @var string|null
*/
public $description;

/**
* The event mutex implementation.
*
Expand Down Expand Up @@ -730,30 +723,6 @@ protected function withOutputCallback(Closure $callback, $onlyIfOutputExists = f
};
}

/**
* Set the human-friendly description of the event.
*
* @param string $description
* @return $this
*/
public function name($description)
{
return $this->description($description);
}

/**
* Set the human-friendly description of the event.
*
* @param string $description
* @return $this
*/
public function description($description)
{
$this->description = $description;

return $this;
}

/**
* Get the summary of the event for display.
*
Expand Down
31 changes: 31 additions & 0 deletions src/Illuminate/Console/Scheduling/ManagesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ trait ManagesAttributes
*/
protected $rejects = [];

/**
* The human readable description of the event.
*
* @var string|null
*/
public $description;

/**
* Set which user the command should run as.
*
Expand Down Expand Up @@ -199,4 +206,28 @@ public function skip($callback)

return $this;
}

/**
* Set the human-friendly description of the event.
*
* @param string $description
* @return $this
*/
public function name($description)
{
return $this->description($description);
}

/**
* Set the human-friendly description of the event.
*
* @param string $description
* @return $this
*/
public function description($description)
{
$this->description = $description;

return $this;
}
}
4 changes: 4 additions & 0 deletions src/Illuminate/Console/Scheduling/PendingEventAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ public function mergeAttributes(Event $event): void
$event->expression = $this->expression;
$event->repeatSeconds = $this->repeatSeconds;

if ($this->description !== null) {
$event->name($this->description);
}

if ($this->timezone !== null) {
$event->timezone($this->timezone);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Illuminate/Console/Scheduling/Schedule.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,15 @@ public function job($job, $queue = null, $connection = null)
: $job::class;
}

return $this->call(function () use ($job, $queue, $connection) {
return $this->name($jobName)->call(function () use ($job, $queue, $connection) {
$job = is_string($job) ? Container::getInstance()->make($job) : $job;

if ($job instanceof ShouldQueue) {
$this->dispatchToQueue($job, $queue ?? $job->queue, $connection ?? $job->connection);
} else {
$this->dispatchNow($job);
}
})->name($jobName);
});
}

/**
Expand Down

0 comments on commit 285d4b7

Please sign in to comment.