Skip to content

Commit 627bb64

Browse files
authored
Add support for Fleet editor in ResolvesDumpSource (#57377)
* Add support for Fleet editor in dump source resolution * fix: PHPStan undefined variable errors in FailoverQueue * fix: PHPStan undefined variable errors in FailoverQueue
1 parent c6722f6 commit 627bb64

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

src/Illuminate/Foundation/Concerns/ResolvesDumpSource.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ trait ResolvesDumpSource
1515
'atom' => 'atom://core/open/file?filename={file}&line={line}',
1616
'cursor' => 'cursor://file/{file}:{line}',
1717
'emacs' => 'emacs://open?url=file://{file}&line={line}',
18+
'fleet' => 'fleet://open?file={file}&line={line}',
1819
'idea' => 'idea://open?file={file}&line={line}',
1920
'kiro' => 'kiro://file/{file}:{line}',
2021
'macvim' => 'mvim://open/?url=file://{file}&line={line}',

src/Illuminate/Queue/FailoverQueue.php

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,18 @@ public function creationTimeOfOldestPendingJob($queue = null)
8686
*/
8787
public function push($job, $data = '', $queue = null)
8888
{
89+
$lastException = null;
90+
8991
foreach ($this->connections as $connection) {
9092
try {
9193
return $this->manager->connection($connection)->push($job, $data, $queue);
9294
} catch (Throwable $e) {
95+
$lastException = $e;
9396
$this->events->dispatch(new QueueFailedOver($connection, $job));
9497
}
9598
}
9699

97-
throw $e;
100+
throw $lastException ?? new \RuntimeException('No available connections to push the job.');
98101
}
99102

100103
/**
@@ -106,15 +109,17 @@ public function push($job, $data = '', $queue = null)
106109
*/
107110
public function pushRaw($payload, $queue = null, array $options = [])
108111
{
112+
$lastException = null;
113+
109114
foreach ($this->connections as $connection) {
110115
try {
111116
return $this->manager->connection($connection)->pushRaw($payload, $queue, $options);
112117
} catch (Throwable $e) {
113-
//
118+
$lastException = $e;
114119
}
115120
}
116121

117-
throw $e;
122+
throw $lastException ?? new \RuntimeException('No available connections to push the raw payload.');
118123
}
119124

120125
/**
@@ -128,15 +133,18 @@ public function pushRaw($payload, $queue = null, array $options = [])
128133
*/
129134
public function later($delay, $job, $data = '', $queue = null)
130135
{
136+
$lastException = null;
137+
131138
foreach ($this->connections as $connection) {
132139
try {
133140
return $this->manager->connection($connection)->later($delay, $job, $data, $queue);
134141
} catch (Throwable $e) {
142+
$lastException = $e;
135143
$this->events->dispatch(new QueueFailedOver($connection, $job));
136144
}
137145
}
138146

139-
throw $e;
147+
throw $lastException ?? new \RuntimeException('No available connections to schedule the job.');
140148
}
141149

142150
/**

0 commit comments

Comments
 (0)