Browse Source

lock inside read, ignore unreadable files

PYADPT-55
Volker Birk 6 years ago
parent
commit
0b9488c2af
  1. 5
      test/minimail.py

5
test/minimail.py

@ -53,12 +53,15 @@ def newer(file1, file2=None):
def recv_all(inbox, marker): def recv_all(inbox, marker):
with Lock(inbox):
r = [] r = []
while not r: while not r:
for f in compress(inbox.glob("*.eml"), partial(newer, file2=marker)): for f in compress(inbox.glob("*.eml"), partial(newer, file2=marker)):
with Lock(inbox):
try:
t = f.readall() t = f.readall()
r.append(t) r.append(t)
except:
pass
if not r: if not r:
sleep(1) sleep(1)
marker.touch(exist_ok=True) marker.touch(exist_ok=True)

Loading…
Cancel
Save