Skip to content

Commit 8f7e082

Browse files
authored
Fix #138 (#139)
* convert datetime.timedelta to seconds before comparison * bump version * remove function from tests * update actions to avoid warnings * fix error --------- Co-authored-by: Jan Caha <jan.caha@lutraconsulting.co.uk>
1 parent b84d41d commit 8f7e082

File tree

6 files changed

+14
-8
lines changed

6 files changed

+14
-8
lines changed

.github/workflows/build_windows.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ jobs:
1010

1111
steps:
1212

13-
- uses: actions/checkout@v3
13+
- uses: actions/checkout@v4
1414

15-
- uses: robinraju/release-downloader@v1.8
15+
- uses: robinraju/release-downloader@v1.10
1616
with:
1717
repository: "MerginMaps/geodiff"
1818
latest: true
@@ -26,7 +26,7 @@ jobs:
2626
cd scripts/windows_binaries
2727
del geodiff_*.zip
2828
29-
- uses: actions/setup-python@v4
29+
- uses: actions/setup-python@v5
3030
with:
3131
python-version: '3.10'
3232

@@ -44,7 +44,7 @@ jobs:
4444
run: copy config.yaml.default scripts/dist/config.yaml
4545

4646
- name: Upload Zip file as artifact
47-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@v4
4848
with:
4949
name: dbsync_standalone_win
5050
path: scripts/dist

.github/workflows/tests_mergin_db_sync.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ jobs:
5959
python3 -m pip install -r requirements.txt
6060
python3 -m pip install -r requirements-dev.txt
6161
62-
6362
- name: Run tests
6463
run: |
6564
pytest test --cov=. --cov-report=term-missing:skip-covered -vv

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 2.1.2
4+
5+
- Fix datetime.timedelta comparison to seconds
6+
37
## 2.1.1
48

59
- Fix failure to start when notifications were not enabled

dbsync_daemon.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ def main():
191191
else:
192192
min_time_delta_hr = 4
193193

194-
if last_email_sent is None or (datetime.datetime.now() - last_email_sent) > min_time_delta_hr * 3600:
194+
if (
195+
last_email_sent is None
196+
or (datetime.datetime.now() - last_email_sent).total_seconds() > min_time_delta_hr * 3600
197+
):
195198
send_email(str(e), config)
196199
last_email_sent = datetime.datetime.now()
197200

test/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
66
License: MIT
77
"""
8+
89
import pytest
910

1011
from config import ConfigError, config, get_ignored_tables, validate_config
@@ -254,7 +255,6 @@ def test_get_ignored_tables():
254255
def test_config_notification_setup():
255256
_reset_config()
256257

257-
# no NOTIFICATIONS set should pass but cannot send email
258258
validate_config(config)
259259

260260
# incomplete setting

version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "2.1.1"
1+
__version__ = "2.1.2"

0 commit comments

Comments
 (0)