X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibmemcached%2Fpurge.cc;h=10c133f2686589edda075f08e1249ed0a49b9757;hb=d7a0084bf99d618d1dc26a54fd413db7ae8b8e63;hp=7f54672ce95e2928ff95eea41cef4e4b8ec50efb;hpb=d3ccb3a18e065b270a58b628482d1ca06f58766c;p=awesomized%2Flibmemcached diff --git a/src/libmemcached/purge.cc b/src/libmemcached/purge.cc index 7f54672c..10c133f2 100644 --- a/src/libmemcached/purge.cc +++ b/src/libmemcached/purge.cc @@ -62,11 +62,11 @@ private: class PollTimeout { public: - PollTimeout(Memcached* arg) : + PollTimeout(Memcached* arg, int32_t ms = 50) : _timeout(arg->poll_timeout), _origin(arg->poll_timeout) { - _origin = 2000; + _origin = ms; } ~PollTimeout() @@ -135,12 +135,15 @@ bool memcached_purge(memcached_instance_st* ptr) * Purge doesn't care for what kind of command results that is received. * The only kind of errors I care about if is I'm out of sync with the * protocol or have problems reading data from the network.. - */ + */ if (rc== MEMCACHED_PROTOCOL_ERROR or rc == MEMCACHED_UNKNOWN_READ_FAILURE or rc == MEMCACHED_READ_FAILURE) { WATCHPOINT_ERROR(rc); is_successful= false; } + if (rc == MEMCACHED_TIMEOUT) { + break; + } if (ptr->root->callbacks != NULL) {