MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / main

Function main

test/sigstop_sigcont.py:59–81  ·  view source on GitHub ↗
(uri: str)

Source from the content-addressed store, hash-verified

57
58
59def main(uri: str) -> None:
60 heartbeat_logger = HeartbeatLogger()
61 client = MongoClient(
62 uri,
63 event_listeners=[heartbeat_logger],
64 heartbeatFrequencyMS=500,
65 connectTimeoutMS=500,
66 server_api=SERVER_API,
67 )
68 client.admin.command("ping")
69 logging.info("TEST STARTED")
70 # test_sigstop_sigcont will SIGSTOP and SIGCONT this process in this loop.
71 while True:
72 try:
73 data = input('Type "q" to quit: ')
74 except EOFError:
75 break
76 if data == "q":
77 break
78 client.admin.command("ping")
79 logging.info("TEST COMPLETED")
80 heartbeat_logger.close()
81 client.close()
82
83
84if __name__ == "__main__":

Callers 1

sigstop_sigcont.pyFile · 0.70

Calls 5

closeMethod · 0.95
closeMethod · 0.95
MongoClientClass · 0.90
HeartbeatLoggerClass · 0.70
commandMethod · 0.45

Tested by

no test coverage detected