【问题标题】:How to ping rethinkdb in python,to check whether db server ain't down?如何在python中ping rethinkdb,检查db服务器是否没有关闭?
【发布时间】:2016-07-21 10:37:24
【问题描述】:
import rethinkdb as r

con=r.connect(host='localhost')

我如何 ping?如何使用现有连接 ping DB 服务器?

【问题讨论】:

    标签: python rethinkdb


    【解决方案1】:

    如果您想检查连接是否仍然健康并正在运行查询,您可以执行r.expr(0).run(conn) == 0 之类的操作。

    【讨论】:

      猜你喜欢
      • 2021-06-09
      • 1970-01-01
      • 1970-01-01
      • 2015-04-07
      • 1970-01-01
      • 2019-12-14
      • 2017-05-09
      • 2017-02-27
      • 2023-03-30
      相关资源
      最近更新 更多