From dd93d40a55ce832d6c15db36defe92537fe190e2 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 20 Jun 2018 21:56:38 -0400 Subject: [PATCH] Small bugfix for ftp crawler --- crawl_server/remote_ftp.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crawl_server/remote_ftp.py b/crawl_server/remote_ftp.py index 40b28bf..3c81521 100644 --- a/crawl_server/remote_ftp.py +++ b/crawl_server/remote_ftp.py @@ -36,14 +36,13 @@ class FtpDirectory(RemoteDirectory): break except ftputil.error.FTPError as e: - if e.errno == 530: + if e.errno == 530 or e.errno == 421: print("Cancel connection - too many connections") break failed_attempts += 1 print("Connection error; reconnecting..." + e.strerror + " " + str(e.errno)) time.sleep(2 * random.uniform(0.5, 1.5)) - self.stop_when_connected() def list_dir(self, path) -> list: if not self.ftp: