格式化代码
This commit is contained in:
parent
f852717191
commit
876f3dff04
@ -118,7 +118,7 @@ private function handleOutgoingRequest(array $message): string
|
||||
private function handleWeightUpdated(array $message): string
|
||||
{
|
||||
$msg = '';
|
||||
if ($message['weight'] === "0") {
|
||||
if ($message['weight'] === '0') {
|
||||
$msg .= '我不参与调度了。';
|
||||
} else {
|
||||
$msg .= '我的权重是:'.$message['weight'].'。';
|
||||
|
@ -24,7 +24,7 @@ class Work extends Command
|
||||
*/
|
||||
protected $description = '启动此应用程序。';
|
||||
|
||||
private string $weight = "1";
|
||||
private string $weight = '1';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
|
@ -66,7 +66,7 @@ public static function updateThisNode($data = []): void
|
||||
{
|
||||
$node_id = config('settings.node.id');
|
||||
|
||||
$node = self::hget('nodes', $node_id, "[]");
|
||||
$node = self::hget('nodes', $node_id, '[]');
|
||||
$node = json_decode($node, true);
|
||||
|
||||
$node = array_merge($node, $data);
|
||||
@ -74,7 +74,6 @@ public static function updateThisNode($data = []): void
|
||||
ClusterSupport::hset('nodes', $node_id, $node);
|
||||
}
|
||||
|
||||
|
||||
public static function hset($key, $value, $data = []): void
|
||||
{
|
||||
/** @noinspection PhpUndefinedMethodInspection */
|
||||
@ -85,7 +84,6 @@ public static function hset($key, $value, $data = []): void
|
||||
* @param string|array $events 事件名称
|
||||
* @param $callback callable 回调函数,接收一个参数,为事件数据。
|
||||
* @param $ignore_self bool 是否忽略此节点的消息。
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public static function listen(string|array $events, callable $callback, bool $ignore_self = true): void
|
||||
|
@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
namespace Deployer;
|
||||
|
||||
require 'recipe/laravel.php';
|
||||
|
Loading…
Reference in New Issue
Block a user