MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / worker

Function worker

test/perf/invalidate_stresstest.py:25–39  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def worker():
26 while True:
27 conn = engine.connect()
28 try:
29 conn.begin()
30 for i in range(5):
31 conn.exec_driver_sql("SELECT 1+1")
32 gevent.sleep(random.random() * 1.01)
33
34 except Exception:
35 # traceback.print_exc()
36 sys.stderr.write("X")
37 else:
38 conn.close()
39 sys.stderr.write(".")
40
41
42def main():

Callers

nothing calls this directly

Calls 6

randomMethod · 0.80
connectMethod · 0.45
beginMethod · 0.45
exec_driver_sqlMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected