mirror of
https://github.com/simon987/od-database.git
synced 2025-04-19 18:36:44 +00:00
Small bugfix for ftp crawler
This commit is contained in:
parent
4ca56d2317
commit
dd93d40a55
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user