Skip to content

Commit 285d4b7

Browse files
[11.x] Fix withoutOverlapping for grouped scheduled closures (#53680)
* fix * formatting --------- Co-authored-by: Taylor Otwell <[email protected]>
1 parent b1f07ed commit 285d4b7

File tree

4 files changed

+37
-33
lines changed

4 files changed

+37
-33
lines changed

src/Illuminate/Console/Scheduling/Event.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ class Event
5959
*/
6060
protected $afterCallbacks = [];
6161

62-
/**
63-
* The human readable description of the event.
64-
*
65-
* @var string|null
66-
*/
67-
public $description;
68-
6962
/**
7063
* The event mutex implementation.
7164
*
@@ -730,30 +723,6 @@ protected function withOutputCallback(Closure $callback, $onlyIfOutputExists = f
730723
};
731724
}
732725

733-
/**
734-
* Set the human-friendly description of the event.
735-
*
736-
* @param string $description
737-
* @return $this
738-
*/
739-
public function name($description)
740-
{
741-
return $this->description($description);
742-
}
743-
744-
/**
745-
* Set the human-friendly description of the event.
746-
*
747-
* @param string $description
748-
* @return $this
749-
*/
750-
public function description($description)
751-
{
752-
$this->description = $description;
753-
754-
return $this;
755-
}
756-
757726
/**
758727
* Get the summary of the event for display.
759728
*

src/Illuminate/Console/Scheduling/ManagesAttributes.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ trait ManagesAttributes
9090
*/
9191
protected $rejects = [];
9292

93+
/**
94+
* The human readable description of the event.
95+
*
96+
* @var string|null
97+
*/
98+
public $description;
99+
93100
/**
94101
* Set which user the command should run as.
95102
*
@@ -199,4 +206,28 @@ public function skip($callback)
199206

200207
return $this;
201208
}
209+
210+
/**
211+
* Set the human-friendly description of the event.
212+
*
213+
* @param string $description
214+
* @return $this
215+
*/
216+
public function name($description)
217+
{
218+
return $this->description($description);
219+
}
220+
221+
/**
222+
* Set the human-friendly description of the event.
223+
*
224+
* @param string $description
225+
* @return $this
226+
*/
227+
public function description($description)
228+
{
229+
$this->description = $description;
230+
231+
return $this;
232+
}
202233
}

src/Illuminate/Console/Scheduling/PendingEventAttributes.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ public function mergeAttributes(Event $event): void
4242
$event->expression = $this->expression;
4343
$event->repeatSeconds = $this->repeatSeconds;
4444

45+
if ($this->description !== null) {
46+
$event->name($this->description);
47+
}
48+
4549
if ($this->timezone !== null) {
4650
$event->timezone($this->timezone);
4751
}

src/Illuminate/Console/Scheduling/Schedule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ public function job($job, $queue = null, $connection = null)
184184
: $job::class;
185185
}
186186

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

190190
if ($job instanceof ShouldQueue) {
191191
$this->dispatchToQueue($job, $queue ?? $job->queue, $connection ?? $job->connection);
192192
} else {
193193
$this->dispatchNow($job);
194194
}
195-
})->name($jobName);
195+
});
196196
}
197197

198198
/**

0 commit comments

Comments
 (0)