Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[11.x] Fix withoutOverlapping for grouped scheduled closures #53680

Merged
merged 2 commits into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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