proxmox-backup-proxy: use only jobstate for garbage_collection schedule
in case the garbage_collection errors out, we never set the in-memory state, so if it failed, the last 'good' starttime was considered for the schedule this could lead to the job running every minute instead of the correct schedule Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
This commit is contained in:
		
				
					committed by
					
						 Thomas Lamprecht
						Thomas Lamprecht
					
				
			
			
				
	
			
			
			
						parent
						
							4fdf5ddf5b
						
					
				
				
					commit
					b6ba5acd29
				
			| @ -295,23 +295,12 @@ async fn schedule_datastore_garbage_collection() { | |||||||
|  |  | ||||||
|         let worker_type = "garbage_collection"; |         let worker_type = "garbage_collection"; | ||||||
|  |  | ||||||
|         let stat = datastore.last_gc_status(); |         let last = match jobstate::last_run_time(worker_type, &store) { | ||||||
|         let last = if let Some(upid_str) = stat.upid { |  | ||||||
|             match upid_str.parse::<UPID>() { |  | ||||||
|                 Ok(upid) => upid.starttime, |  | ||||||
|                 Err(err) => { |  | ||||||
|                     eprintln!("unable to parse upid '{}' - {}", upid_str, err); |  | ||||||
|                     continue; |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         } else { |  | ||||||
|             match jobstate::last_run_time(worker_type, &store) { |  | ||||||
|             Ok(time) => time, |             Ok(time) => time, | ||||||
|             Err(err) => { |             Err(err) => { | ||||||
|                 eprintln!("could not get last run time of {} {}: {}", worker_type, store, err); |                 eprintln!("could not get last run time of {} {}: {}", worker_type, store, err); | ||||||
|                 continue; |                 continue; | ||||||
|             } |             } | ||||||
|             } |  | ||||||
|         }; |         }; | ||||||
|  |  | ||||||
|         let next = match compute_next_event(&event, last, false) { |         let next = match compute_next_event(&event, last, false) { | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user