send notification mails for GC and verify jobs

This commit is contained in:
Dietmar Maurer
2020-10-27 13:36:56 +01:00
parent acc3d9df5a
commit b9e7bcc272
4 changed files with 272 additions and 3 deletions

View File

@ -240,11 +240,19 @@ async fn schedule_tasks() -> Result<(), Error> {
async fn schedule_datastore_garbage_collection() {
use proxmox_backup::config::datastore::{
self,
DataStoreConfig,
use proxmox_backup::config::{
datastore::{
self,
DataStoreConfig,
},
user::{
self,
User,
},
};
let email = server::lookup_user_email(Userid::root_userid());
let config = match datastore::config() {
Err(err) => {
eprintln!("unable to read datastore config - {}", err);
@ -325,6 +333,7 @@ async fn schedule_datastore_garbage_collection() {
};
let store2 = store.clone();
let email2 = email.clone();
if let Err(err) = WorkerTask::new_thread(
worker_type,
@ -345,6 +354,13 @@ async fn schedule_datastore_garbage_collection() {
eprintln!("could not finish job state for {}: {}", worker_type, err);
}
if let Some(email2) = email2 {
let gc_status = datastore.last_gc_status();
if let Err(err) = crate::server::send_gc_status(&email2, datastore.name(), &gc_status, &result) {
eprintln!("send gc notification failed: {}", err);
}
}
result
}
) {