['name' => 's2', 'host' => 's2.lb.fluidbook.com', 'weight' => 2],
['name' => 's3', 'host' => 's3.lb.fluidbook.com', 'weight' => 2],
['name' => 's4', 'host' => 's4.lb.fluidbook.com', 'weight' => 2],
- ['name' => 's5', 'host' => 's5.lb.fluidbook.com', 'weight' => 5],
- ['name' => 's6', 'host' => 's6.lb.fluidbook.com', 'weight' => 5],
+ ['name' => 's5', 'host' => 's5.lb.fluidbook.com', 'weight' => 8],
+ ['name' => 's6', 'host' => 's6.lb.fluidbook.com', 'weight' => 8],
];
protected static function _pingCache()
$pings = $cached;
}
}
+ $okServers = [];
foreach ($servers as $id => $server) {
if ($echo) {
$pings[$id] = $ok;
if ($ok) {
+ $okServers[] = ['h' => $server['host'], 'w' => $server['weight']];
for ($i = 0; $i < $server['weight']; $i++) {
$available[] = $server['host'];
}
file_put_contents($cache, json_encode($pings));
file_put_contents(self::_serversCache(), json_encode($servers));
file_put_contents(public_path('lb.json'), json_encode($available));
+ file_put_contents(public_path('lbw.json'), json_encode($okServers));
}
protected static function _serversCache()