Skip to content
Snippets Groups Projects
Commit 8dad1e5c authored by Thomas Kluyver's avatar Thomas Kluyver
Browse files

Move sleep after first getfattr check

parent 563c46f1
No related branches found
No related tags found
1 merge request!435Use asyncio subprocess interface in webservice code
...@@ -74,6 +74,6 @@ async def test_wait_on_transfer(tmp_path): ...@@ -74,6 +74,6 @@ async def test_wait_on_transfer(tmp_path):
'getfattr', 'getfattr',
content="""#!{}\nprint('user.status="dCache"')""".format(sys.executable) content="""#!{}\nprint('user.status="dCache"')""".format(sys.executable)
) )
with mock.patch('asyncio.sleep'), mock_getfattr: with mock_getfattr:
res = await wait_on_transfer(tmp_path, max_tries=1) res = await wait_on_transfer(tmp_path, max_tries=1)
assert res is True assert res is True
...@@ -498,7 +498,6 @@ async def wait_on_transfer(rpath, max_tries=300): ...@@ -498,7 +498,6 @@ async def wait_on_transfer(rpath, max_tries=300):
# FIXME: if not kafka, then do event-driven, no sleep # FIXME: if not kafka, then do event-driven, no sleep
# wait until files are migrated # wait until files are migrated
while True: while True:
await asyncio.sleep(10)
retcode, stdout = await run_proc_async([ retcode, stdout = await run_proc_async([
"getfattr", "-n", "user.status", rpath "getfattr", "-n", "user.status", rpath
]) ])
...@@ -507,6 +506,7 @@ async def wait_on_transfer(rpath, max_tries=300): ...@@ -507,6 +506,7 @@ async def wait_on_transfer(rpath, max_tries=300):
if tries > max_tries: if tries > max_tries:
return False return False
tries += 1 tries += 1
await asyncio.sleep(10)
def check_files(in_folder: str, def check_files(in_folder: str,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment