file cleanup
This commit is contained in:
8
vendor/laravel/horizon/composer.json
vendored
8
vendor/laravel/horizon/composer.json
vendored
@@ -15,9 +15,9 @@
|
||||
"ext-pcntl": "*",
|
||||
"ext-posix": "*",
|
||||
"cakephp/chronos": "^1.0",
|
||||
"illuminate/contracts": "~5.7.0|~5.8.0|^6.0|^7.0",
|
||||
"illuminate/queue": "~5.7.0|~5.8.0|^6.0|^7.0",
|
||||
"illuminate/support": "~5.7.0|~5.8.0|^6.0|^7.0",
|
||||
"illuminate/contracts": "~5.7.0|~5.8.0|^6.0",
|
||||
"illuminate/queue": "~5.7.0|~5.8.0|^6.0",
|
||||
"illuminate/support": "~5.7.0|~5.8.0|^6.0",
|
||||
"predis/predis": "^1.1",
|
||||
"ramsey/uuid": "^3.5",
|
||||
"symfony/process": "^4.2",
|
||||
@@ -25,7 +25,7 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "^1.0",
|
||||
"orchestra/testbench": "^3.7|^4.0|^5.0",
|
||||
"orchestra/testbench": "^3.7|^4.0",
|
||||
"phpunit/phpunit": "^7.0|^8.0"
|
||||
},
|
||||
"autoload": {
|
||||
|
||||
2
vendor/laravel/horizon/public/app.js
vendored
2
vendor/laravel/horizon/public/app.js
vendored
File diff suppressed because one or more lines are too long
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"/app.js": "/app.js?id=f41217b645f8cd9ffacc",
|
||||
"/app.js": "/app.js?id=dbc6b1d1957be6dae833",
|
||||
"/app.css": "/app.css?id=b95d548aba488172f4b4",
|
||||
"/app-dark.css": "/app-dark.css?id=b5b064c2f5a4b673a1c5"
|
||||
}
|
||||
|
||||
@@ -108,7 +108,8 @@
|
||||
* @returns {string}
|
||||
*/
|
||||
prettyPrintJob(data) {
|
||||
return data.command ? phpunserialize(data.command) : data;
|
||||
return data.command && !data.command.includes('CallQueuedClosure')
|
||||
? phpunserialize(data.command) : data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
21
vendor/laravel/horizon/src/AutoScaler.php
vendored
21
vendor/laravel/horizon/src/AutoScaler.php
vendored
@@ -79,7 +79,10 @@ class AutoScaler
|
||||
return $pools->mapWithKeys(function ($pool, $queue) use ($supervisor) {
|
||||
$size = $this->queue->connection($supervisor->options->connection)->readyNow($queue);
|
||||
|
||||
return [$queue => ($size * $this->metrics->runtimeForQueue($queue))];
|
||||
return [$queue => [
|
||||
'size' => $size,
|
||||
'time' => ($size * $this->metrics->runtimeForQueue($queue)),
|
||||
]];
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,20 +90,24 @@ class AutoScaler
|
||||
* Get the number of workers needed per queue for proper balance.
|
||||
*
|
||||
* @param \Laravel\Horizon\Supervisor $supervisor
|
||||
* @param \Illuminate\Support\Collection $timeToClear
|
||||
* @param \Illuminate\Support\Collection $queues
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
protected function numberOfWorkersPerQueue(Supervisor $supervisor, Collection $timeToClear)
|
||||
protected function numberOfWorkersPerQueue(Supervisor $supervisor, Collection $queues)
|
||||
{
|
||||
$timeToClearAll = $timeToClear->sum();
|
||||
$timeToClearAll = $queues->sum('time');
|
||||
|
||||
return $timeToClear->mapWithKeys(function ($timeToClear, $queue) use ($supervisor, $timeToClearAll) {
|
||||
return $queues->mapWithKeys(function ($timeToClear, $queue) use ($supervisor, $timeToClearAll) {
|
||||
if ($timeToClearAll > 0 &&
|
||||
$supervisor->options->autoScaling()) {
|
||||
return [$queue => (($timeToClear / $timeToClearAll) * $supervisor->options->maxProcesses)];
|
||||
return [$queue => (($timeToClear['time'] / $timeToClearAll) * $supervisor->options->maxProcesses)];
|
||||
} elseif ($timeToClearAll == 0 &&
|
||||
$supervisor->options->autoScaling()) {
|
||||
return [$queue => $supervisor->options->minProcesses];
|
||||
return [
|
||||
$queue => $timeToClear['size']
|
||||
? $supervisor->options->maxProcesses
|
||||
: $supervisor->options->minProcesses,
|
||||
];
|
||||
}
|
||||
|
||||
return [$queue => $supervisor->options->maxProcesses / count($supervisor->processPools)];
|
||||
|
||||
@@ -259,18 +259,16 @@ class RedisJobRepository implements JobRepository
|
||||
|
||||
$time = str_replace(',', '.', microtime(true));
|
||||
|
||||
$pipe->hmset(
|
||||
$payload->id(), [
|
||||
'id' => $payload->id(),
|
||||
'connection' => $connection,
|
||||
'queue' => $queue,
|
||||
'name' => $payload->decoded['displayName'],
|
||||
'status' => 'pending',
|
||||
'payload' => $payload->value,
|
||||
'created_at' => $time,
|
||||
'updated_at' => $time,
|
||||
]
|
||||
);
|
||||
$pipe->hmset($payload->id(), [
|
||||
'id' => $payload->id(),
|
||||
'connection' => $connection,
|
||||
'queue' => $queue,
|
||||
'name' => $payload->decoded['displayName'],
|
||||
'status' => 'pending',
|
||||
'payload' => $payload->value,
|
||||
'created_at' => $time,
|
||||
'updated_at' => $time,
|
||||
]);
|
||||
|
||||
$pipe->expireat(
|
||||
$payload->id(), Chronos::now()->addMinutes($this->recentJobExpires)->getTimestamp()
|
||||
|
||||
Reference in New Issue
Block a user