Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2021-06-01 20:36:51 +0200
committerErich Eckner <git@eckner.net>2021-06-01 20:36:51 +0200
commit3e49ee9a9b9f517f0f53dbee73b498797cdec283 (patch)
tree0db182e0ddce8a26fbb0cac91c61cd0003305048
parent3ea727741ce79de6172441a22a7af7cfc9519371 (diff)
reflector-2020.12.7.1.tar.xz
-rw-r--r--Reflector.py18
-rw-r--r--setup.py2
2 files changed, 15 insertions, 5 deletions
diff --git a/Reflector.py b/Reflector.py
index 95b6798..7b6b7ab 100644
--- a/Reflector.py
+++ b/Reflector.py
@@ -206,10 +206,20 @@ class DownloadTimer():
return self
def __exit__(self, typ, value, traceback):
- self.time = time.time() - self.start_time
+ time_delta = time.time() - self.start_time
+ signal.alarm(0)
+ self.time = time_delta
if self.timeout > 0:
signal.signal(signal.SIGALRM, self.previous_handler)
- signal.alarm(self.previous_timer)
+
+ previous_timer = self.previous_timer
+ if previous_timer > 0:
+ remaining_time = int(previous_timer - time_delta)
+ # The alarm should have been raised during the download.
+ if remaining_time <= 0:
+ signal.raise_signal(signal.SIGALRM)
+ else:
+ signal.alarm(remaining_time)
self.start_time = None
@@ -276,7 +286,7 @@ def rate_rsync(
DownloadTimeout
) as err:
logger = get_logger()
- logger.info('failed to rate rsync download (%s): %s', db_url, err)
+ logger.warning('failed to rate rsync download (%s): %s', db_url, err)
return 0, 0
@@ -304,7 +314,7 @@ def rate_http(
DownloadTimeout
) as err:
logger = get_logger()
- logger.info('failed to rate http(s) download (%s): %s', db_url, err)
+ logger.warning('failed to rate http(s) download (%s): %s', db_url, err)
return 0, 0
diff --git a/setup.py b/setup.py
index 81f2875..29a73e6 100644
--- a/setup.py
+++ b/setup.py
@@ -5,7 +5,7 @@ import time
setup(
name='''Reflector''',
- version=time.strftime('%Y.%m.%d.%H.%M.%S', time.gmtime(1607320056)),
+ version=time.strftime('%Y.%m.%d.%H.%M.%S', time.gmtime(1607321105)),
description='''A Python 3 module and script to retrieve and filter the latest Pacman mirror list.''',
author='''Xyne''',
author_email='''ac xunilhcra enyx, backwards''',