ret->qps=QPSLimiter(qpsVal, qpsVal);
}
- auto localPools = g_pools.getCopy();
- if(vars.count("pool")) {
- if(auto* pool = boost::get<string>(&vars["pool"]))
- ret->pools.insert(*pool);
- else {
- auto pools = boost::get<vector<pair<int, string> > >(vars["pool"]);
- for(auto& p : pools)
- ret->pools.insert(p.second);
- }
- for(const auto& poolName: ret->pools) {
- addServerToPool(localPools, poolName, ret);
- }
- }
- else {
- addServerToPool(localPools, "", ret);
- }
- g_pools.setState(localPools);
-
if(vars.count("order")) {
ret->order=std::stoi(boost::get<string>(vars["order"]));
}
}
}
+ /* this needs to be done _AFTER_ the order has been set,
+ since the server are kept ordered inside the pool */
+ auto localPools = g_pools.getCopy();
+ if(vars.count("pool")) {
+ if(auto* pool = boost::get<string>(&vars["pool"])) {
+ ret->pools.insert(*pool);
+ }
+ else {
+ auto pools = boost::get<vector<pair<int, string> > >(vars["pool"]);
+ for(auto& p : pools) {
+ ret->pools.insert(p.second);
+ }
+ }
+ for(const auto& poolName: ret->pools) {
+ addServerToPool(localPools, poolName, ret);
+ }
+ }
+ else {
+ addServerToPool(localPools, "", ret);
+ }
+ g_pools.setState(localPools);
+
if (ret->connected) {
if(g_launchWork) {
g_launchWork->push_back([ret,cpus]() {