def refresh(self):
assert greenlet.getcurrent().parent is not None,\
"Should be on child greenlet"
try:
self.rsc.refresh()
except pymongo.errors.AutoReconnect:
pass
# RSC has been collected or there
# was an unexpected error.
except:
return
finally:
# Switch to greenlets blocked in wait_for_refresh().
self.refreshed.set()
self.timeout_obj = self.io_loop.add_timeout(
time.time() + self._refresh_interval, self.async_refresh)
评论列表
文章目录