projects
/
m6w6
/
libmemcached
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
remove ambigous Cluster ctor
[m6w6/libmemcached]
/
test
/
lib
/
Cluster.cpp
diff --git
a/test/lib/Cluster.cpp
b/test/lib/Cluster.cpp
index 4fcdb47bcbc358e94664f4dc3fe07fc19706dbbd..3ecc6e9abea2d629009e3a54cf05e610bdef2e7c 100644
(file)
--- a/
test/lib/Cluster.cpp
+++ b/
test/lib/Cluster.cpp
@@
-7,9
+7,6
@@
Cluster::Cluster(Server serv, uint16_t cnt)
: count{cnt}
, proto{move(serv)}
{
: count{cnt}
, proto{move(serv)}
{
- if (count < 4) {
- count = stoi(getenv_else("MEMCACHED_CLUSTER", "4"));
- }
if (!count) {
count = 1;
}
if (!count) {
count = 1;
}
@@
-18,13
+15,6
@@
Cluster::Cluster(Server serv, uint16_t cnt)
}
}
}
}
-Cluster::Cluster(vector<Server> servers)
-: count{servers.size()}
-, cluster{move(servers)}
-{
-
-}
-
Cluster::~Cluster() {
stop();
wait();
Cluster::~Cluster() {
stop();
wait();
@@
-46,11
+36,15
@@
bool Cluster::start() {
return started;
}
return started;
}
-void Cluster::stop() {
+void Cluster::stop(
bool graceful
) {
for (auto &server : cluster) {
server.drain();
for (auto &server : cluster) {
server.drain();
- // no cookies for memcached; TERM is just too slow
- server.signal(SIGKILL);
+ if (graceful) {
+ server.stop();
+ } else {
+ // no cookies for memcached; TERM is just too slow
+ server.signal(SIGKILL);
+ }
}
}
}
}