Merge pull request #314 from SamSchott/develop

v1.4.1
This commit is contained in:
SamSchott 2021-02-14 23:59:13 +00:00 committed by GitHub
commit 51614e6f1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 15 deletions

View File

@ -11,7 +11,7 @@ sys.path.insert(0, os.path.abspath("../src"))
# -- Project information ---------------------------------------------------------------
author = "Sam Schott"
version = "1.4.0"
version = "1.4.1"
release = version
project = "Maestral"
title = "Maestral API Documentation"

View File

@ -1,5 +1,5 @@
[bumpversion]
current_version = 1.4.0
current_version = 1.4.1
commit = True
tag = False
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<build>\d+))?

View File

@ -55,7 +55,7 @@ setup(
name="maestral",
author="Sam Schott",
author_email="ss2151@cam.ac.uk",
version="1.4.0",
version="1.4.1",
url="https://github.com/SamSchott/maestral",
description="Open-source Dropbox client for macOS and Linux.",
license="MIT",

View File

@ -2,7 +2,7 @@
import warnings
__version__ = "1.4.0"
__version__ = "1.4.1"
__author__ = "Sam Schott"
__url__ = "https://github.com/SamSchott/maestral"

View File

@ -3933,19 +3933,21 @@ class SyncMonitor:
while self._connection_helper_running:
self.connected = check_connection("www.dropbox.com")
connected = check_connection("www.dropbox.com")
if self.connected and not self.running.is_set() and self.autostart.is_set():
logger.info(CONNECTED)
self.start()
if connected != self.connected:
elif not self.connected and self.running.is_set():
# Log the status change.
logger.info(CONNECTED if connected else CONNECTING)
# Don't stop sync threads, let them deal with the connection issues with
# their own timeout. This prevents us from aborting any uploads or
# downloads which could still be saved on reconnection.
if not self.sync.busy():
logger.info(IDLE)
logger.info(CONNECTING)
if connected:
if not self.running.is_set() and self.autostart.is_set():
self.start()
self.connected = connected
time.sleep(self.connection_check_interval)

View File

@ -193,16 +193,17 @@ def cpu_usage_percent(interval: float = 0.1) -> float:
return round(single_cpu_percent, 1)
def check_connection(hostname: str) -> bool:
def check_connection(hostname: str, timeout: int = 2) -> bool:
"""
A low latency check for an internet connection.
:param hostname: Hostname to use for connection check.
:param timeout: Timeout in seconds for connection check.
:returns: Connection availability.
"""
try:
host = socket.gethostbyname(hostname)
s = socket.create_connection((host, 80), 2)
s = socket.create_connection(address=(host, 80), timeout=timeout)
s.close()
return True
except Exception: