Skip to content

Send notifications if sync has an error#125

Merged
wonder-sk merged 32 commits intomasterfrom
notification
Aug 17, 2023
Merged

Send notifications if sync has an error#125
wonder-sk merged 32 commits intomasterfrom
notification

Conversation

@JanCaha
Copy link
Collaborator

@JanCaha JanCaha commented Jul 21, 2023

Adds Notification section to config, which if set up correctly will send email if sync has an error.

Fixes #56

@JanCaha JanCaha requested a review from wonder-sk July 21, 2023 10:23
log_functions.py Outdated
msg.preamble = error

if date_time:
error = f"{date_time}: {error}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How much context is there in error ? A common issue may be that database schema has been modified. How would such an email look like?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error may look like:

26/07/2023 11:59:36: geodiff failed!
['geodiff', 'diff', '--driver', 'postgres', 'host=localhost dbname=mergin_dbsync user=admin password='*****' port=5430', 'db_sync_base', 'db_sync_main', '/tmp/db-sync-dbsync-push-base2our']

JanCaha and others added 8 commits August 4, 2023 14:53
Co-authored-by: Martin Dobias <wonder.sk@gmail.com>
Co-authored-by: Martin Dobias <wonder.sk@gmail.com>
Co-authored-by: Martin Dobias <wonder.sk@gmail.com>
@JanCaha
Copy link
Collaborator Author

JanCaha commented Aug 4, 2023

Should be all fixed

@wonder-sk wonder-sk merged commit 80e77be into master Aug 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an option to notify admin when sync breaks

2 participants