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; + } +}