adapt compute_next_event to new signature
the 'utc' flag is now contained in the event itself and not given as a flag to 'compute_next_event' anymore Signed-off-by: Dominik Csapak <d.csapak@proxmox.com> Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
This commit is contained in:
parent
c72f8784a5
commit
7549114c9f
@ -100,7 +100,7 @@ proxmox-router = { version = "1.1", features = [ "cli" ] }
|
|||||||
proxmox-schema = { version = "1", features = [ "api-macro" ] }
|
proxmox-schema = { version = "1", features = [ "api-macro" ] }
|
||||||
proxmox-section-config = "1"
|
proxmox-section-config = "1"
|
||||||
proxmox-tfa = { version = "2", features = [ "api", "api-types" ] }
|
proxmox-tfa = { version = "2", features = [ "api", "api-types" ] }
|
||||||
proxmox-time = "1.1.1"
|
proxmox-time = "1.1.2"
|
||||||
proxmox-uuid = "1"
|
proxmox-uuid = "1"
|
||||||
proxmox-serde = "0.1"
|
proxmox-serde = "0.1"
|
||||||
proxmox-shared-memory = "0.2"
|
proxmox-shared-memory = "0.2"
|
||||||
|
@ -585,7 +585,7 @@ async fn schedule_datastore_garbage_collection() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let next = match event.compute_next_event(last, false) {
|
let next = match event.compute_next_event(last) {
|
||||||
Ok(Some(next)) => next,
|
Ok(Some(next)) => next,
|
||||||
Ok(None) => continue,
|
Ok(None) => continue,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
@ -1040,7 +1040,7 @@ fn check_schedule(worker_type: &str, event_str: &str, id: &str) -> bool {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let next = match event.compute_next_event(last, false) {
|
let next = match event.compute_next_event(last) {
|
||||||
Ok(Some(next)) => next,
|
Ok(Some(next)) => next,
|
||||||
Ok(None) => return false,
|
Ok(None) => return false,
|
||||||
Err(err) => {
|
Err(err) => {
|
||||||
|
@ -341,7 +341,7 @@ pub fn compute_schedule_status(
|
|||||||
if let Some(schedule) = schedule {
|
if let Some(schedule) = schedule {
|
||||||
if let Ok(event) = schedule.parse::<CalendarEvent>() {
|
if let Ok(event) = schedule.parse::<CalendarEvent>() {
|
||||||
// ignore errors
|
// ignore errors
|
||||||
status.next_run = event.compute_next_event(last, false).unwrap_or(None);
|
status.next_run = event.compute_next_event(last).unwrap_or(None);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -533,7 +533,7 @@ impl Inventory {
|
|||||||
set_start_time
|
set_start_time
|
||||||
}
|
}
|
||||||
MediaSetPolicy::CreateAt(ref event) => {
|
MediaSetPolicy::CreateAt(ref event) => {
|
||||||
match event.compute_next_event(set_start_time, false) {
|
match event.compute_next_event(set_start_time) {
|
||||||
Ok(Some(next)) => next,
|
Ok(Some(next)) => next,
|
||||||
Ok(None) | Err(_) => return i64::MAX,
|
Ok(None) | Err(_) => return i64::MAX,
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ impl MediaPool {
|
|||||||
}
|
}
|
||||||
MediaSetPolicy::CreateAt(event) => {
|
MediaSetPolicy::CreateAt(event) => {
|
||||||
if let Some(set_start_time) = self.inventory.media_set_start_time(&self.current_media_set.uuid()) {
|
if let Some(set_start_time) = self.inventory.media_set_start_time(&self.current_media_set.uuid()) {
|
||||||
if let Ok(Some(alloc_time)) = event.compute_next_event(set_start_time as i64, false) {
|
if let Ok(Some(alloc_time)) = event.compute_next_event(set_start_time as i64) {
|
||||||
if current_time >= alloc_time {
|
if current_time >= alloc_time {
|
||||||
create_new_set = Some(String::from("policy CreateAt event triggered"));
|
create_new_set = Some(String::from("policy CreateAt event triggered"));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user