Integration of Apprise notification services as a configurable option#14
Integration of Apprise notification services as a configurable option#14brott8 wants to merge 3 commits intofirasdib:mainfrom
Conversation
brott8
commented
Jul 21, 2024
- Integration of Apprise notification services for Snapraid process results.
- Handling split parity in sanity checks
…on for Snapraid process results. - Update of touch regex to account for "a" in versions of Snapraid - Handling split parity in sanity checks
| snapraid_status, flags=re.MULTILINE) | ||
| zero_subsecond_count = re.search( | ||
| r'^You have (?P<touch_files>\d+) files with (?:a )?zero sub-second timestamp', snapraid_status, | ||
| r'^You have (?P<touch_files>\d+) files with( a)? zero sub-second timestamp', snapraid_status, |
There was a problem hiding this comment.
Could you please change this back
There was a problem hiding this comment.
Yes, I must have had an old version that I merged against. I'll amend.
|
|
||
| file_regex = re.compile(r'^(content|(?:\d+-)?parity) +(.+/\w+.(?:content|(?:\d+-)?parity)) *$', | ||
| #Split parity handling | ||
| file_regex = re.compile(r'^(content|parity) +(.+/\w+.(?:content|parity)) *$', |
There was a problem hiding this comment.
Same as above - I'll amend this. Split parity is obviously already handled in your regex.
| apprise_report = create_apprise_report(report_data) | ||
| send_apprise('SnapRAID Job Completed Successfully', apprise_report) |
There was a problem hiding this comment.
Shouldn't these be guarded to ensure the feature is enabled?
There was a problem hiding this comment.
To be honest, I followed your send_mail implementation. This relies on the enabled flag within the routine to guard. It won't execute if not enabled:
is_enabled, apprise_bin, config_loc = itemgetter(
'enabled', 'binary', 'config')(config['notifications']['apprise'])
if not is_enabled:
return
The main downside of this approach is that the template execution runs every time regardless. I can suggest bringing the enabled flag into the main routine for both email and apprise, following your discord implementation.
- Reverting touch regex - Reverting regex for split parity