MCPcopy
hub / github.com/redis/redis-py / _wait_for_bgsave

Method _wait_for_bgsave

tests/test_commands.py:96–104  ·  view source on GitHub ↗
(self, r, timeout=10)

Source from the content-addressed store, hash-verified

94
95class TestRedisCommands:
96 def _wait_for_bgsave(self, r, timeout=10):
97 deadline = time.monotonic() + timeout
98 while True:
99 info = r.info("persistence")
100 if int(info.get("rdb_bgsave_in_progress", 0)) == 0:
101 return
102 if time.monotonic() > deadline:
103 pytest.fail("Timed out waiting for BGSAVE to finish")
104 time.sleep(0.05)
105
106 @pytest.mark.onlynoncluster
107 @skip_if_redis_enterprise()

Callers 1

test_bgsaveMethod · 0.95

Calls 4

monotonicMethod · 0.80
infoMethod · 0.45
getMethod · 0.45
sleepMethod · 0.45

Tested by

no test coverage detected