From 118e5e05500d2fae1d0a36aa8bf9b06bfebab661 Mon Sep 17 00:00:00 2001 From: "iVampireSP.com" Date: Thu, 9 Feb 2023 18:56:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20=E6=9D=83=E9=87=8D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Console/Commands/Cluster/Weight.php | 46 +++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 app/Console/Commands/Cluster/Weight.php diff --git a/app/Console/Commands/Cluster/Weight.php b/app/Console/Commands/Cluster/Weight.php new file mode 100644 index 0000000..d7a2478 --- /dev/null +++ b/app/Console/Commands/Cluster/Weight.php @@ -0,0 +1,46 @@ +argument('weight'); + + $this->info("当前节点的权重为:{$weight}"); + + ClusterSupport::updateThisNode([ + 'weight' => $weight, + ]); + + ClusterSupport::publish('weight.updated', [ + 'weight' => $weight, + ]); + + return CommandAlias::SUCCESS; + } +}