Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何测试查询是否成功,例如由于连接问题?我正在使用扭曲的txmongo驱动程序。
我的应用程序从 RabbitMQ 获取一些东西并将其放入 MongoDB。我需要能够测试是否存在一些问题,这样我就不会确认该消息并将其存储在队列中。
我查看了代码,但找不到合适的方法。我是使用扭曲的新手。有一个警告RuntimeWarning("not connected"),但它不是一个例外被抓住。也许可以测试factory.size > 0
RuntimeWarning("not connected")
factory.size > 0