db-sync icon indicating copy to clipboard operation
db-sync copied to clipboard

Emails are not send in case of exception

Open uprel opened this issue 1 year ago • 0 comments

There is a error in dbsync_daemon to send email in case of exception. This is what I have in logs

Basically first is any kind of error that triggers exception and then:

2024-05-23T22:09:50.416073471Z During handling of the above exception, another exception occurred:
2024-05-23T22:09:50.416082414Z
2024-05-23T22:09:50.416089281Z Traceback (most recent call last):
2024-05-23T22:09:50.416096209Z   File "dbsync_daemon.py", line 203, in <module>
2024-05-23T22:09:50.416485486Z     main()
2024-05-23T22:09:50.416520222Z   File "dbsync_daemon.py", line 194, in main
2024-05-23T22:09:50.416529923Z     if last_email_sent is None or (datetime.datetime.now() - last_email_sent) > min_time_delta_hr * 3600:
2024-05-23T22:09:50.416538203Z TypeError: '>' not supported between instances of 'datetime.timedelta' and 'int'

Calculation if email should be sent or not is apparently wrong.

uprel avatar May 28 '24 08:05 uprel