From 0643cc2f06f175451439a4bed71478ff6825494a Mon Sep 17 00:00:00 2001 From: Jason Gunthorpe Date: Fri, 21 Feb 2020 11:24:35 -0400 Subject: Catch failures from the sha1sum fork This should trigger a sleep and retry, not a program failure. It happens if the sha1sum races with the user renaming a MailDir file. Signed-off-by: Jason Gunthorpe --- cloud_mdir_sync/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cloud_mdir_sync/main.py b/cloud_mdir_sync/main.py index d810956..d085dda 100644 --- a/cloud_mdir_sync/main.py +++ b/cloud_mdir_sync/main.py @@ -3,6 +3,7 @@ import argparse import asyncio import contextlib import os +import subprocess from typing import Dict, Optional, Tuple import aiohttp @@ -82,7 +83,7 @@ async def synchronize_mail(cfg: config.Config): msgs = nmsgs except (FileNotFoundError, asyncio.TimeoutError, aiohttp.client_exceptions.ClientError, IOError, - RuntimeError): + RuntimeError, subprocess.CalledProcessError): cfg.logger.exception( "Failed update cycle, sleeping then retrying") await asyncio.sleep(10) -- cgit v1.2.3