chore: add DEBUG, logs to monitor
This commit is contained in:
		
							parent
							
								
									66ccd59f07
								
							
						
					
					
						commit
						07105a7d17
					
				
							
								
								
									
										13
									
								
								src/main.rs
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/main.rs
									
									
									
									
									
								
							@ -182,7 +182,7 @@ pub async fn run_cache_clouds() -> Result<()> {
 | 
			
		||||
			arg_env_path=args[idx+1].to_owned();
 | 
			
		||||
		}
 | 
			
		||||
  });
 | 
			
		||||
  println!("Cache service on Clouds: run {} __________ {} / {} ",chrono::Utc::now().timestamp(),&arg_cfg_path,&arg_env_path);
 | 
			
		||||
  println!("Cache service on Clouds: run {} __________ {}  {} ",chrono::Utc::now().timestamp(),&arg_cfg_path,&arg_env_path);
 | 
			
		||||
	let mut cloud = Cloud::default();
 | 
			
		||||
	load_cloud_env(&mut cloud).await;	
 | 
			
		||||
	let mut app_env = AppEnv::default();
 | 
			
		||||
@ -218,7 +218,7 @@ pub async fn run_check_clouds() -> Result<()> {
 | 
			
		||||
			arg_env_path=args[idx+1].to_owned();
 | 
			
		||||
		}
 | 
			
		||||
  });
 | 
			
		||||
  println!("Check Cloud services: run {} __________ {} / {} ",chrono::Utc::now().timestamp(),&arg_cfg_path,&arg_env_path);
 | 
			
		||||
  println!("Check Cloud services: run {} __________ {} {} ",chrono::Utc::now().timestamp(),&arg_cfg_path,&arg_env_path);
 | 
			
		||||
	let mut cloud = Cloud::default();
 | 
			
		||||
	load_cloud_env(&mut cloud).await;	
 | 
			
		||||
	let mut app_env = AppEnv::default();
 | 
			
		||||
@ -253,7 +253,7 @@ pub async fn run_clouds_monitor() -> Result<()> {
 | 
			
		||||
			arg_env_path=args[idx+1].to_owned();
 | 
			
		||||
		}
 | 
			
		||||
  });
 | 
			
		||||
  println!("Monitor Cloud: run {} __________ {} / {} ",chrono::Utc::now().timestamp(),&arg_cfg_path,&arg_env_path);
 | 
			
		||||
  println!("Monitor Cloud: run {} __________ {}  {} ",chrono::Utc::now().timestamp(),&arg_cfg_path,&arg_env_path);
 | 
			
		||||
	let mut cloud = Cloud::default();
 | 
			
		||||
	load_cloud_env(&mut cloud).await;	
 | 
			
		||||
	let mut app_env = AppEnv::default();
 | 
			
		||||
@ -332,20 +332,27 @@ pub async fn main() -> BxDynResult<()> {  //std::io::Result<()> {
 | 
			
		||||
				eprintln!("Task {} no schedule defined",&it.name);
 | 
			
		||||
				continue;
 | 
			
		||||
			}
 | 
			
		||||
		  let debug=envmnt::get_isize("DEBUG",0);
 | 
			
		||||
			let res = match it.name.as_str() {
 | 
			
		||||
				"monitor" => 
 | 
			
		||||
					sched.add(Job::new(&it.schedule.to_owned(), move |uuid, _l| {
 | 
			
		||||
						if debug > 0 {
 | 
			
		||||
							println!("Schedule {} {}: {}",&it.name,&it.schedule,uuid);
 | 
			
		||||
						}
 | 
			
		||||
						tokio::spawn(async {run_clouds_monitor().await});
 | 
			
		||||
					})?),
 | 
			
		||||
				"check" => 
 | 
			
		||||
					sched.add(Job::new(&it.schedule.to_owned(), move |uuid, _l| {
 | 
			
		||||
						if debug > 0 {
 | 
			
		||||
							println!("Schedule {} {}: {}",&it.name,&it.schedule,uuid);
 | 
			
		||||
						}
 | 
			
		||||
						tokio::spawn(async {run_check_clouds().await});
 | 
			
		||||
					})?),
 | 
			
		||||
				"cache" => 
 | 
			
		||||
					sched.add(Job::new(&it.schedule.to_owned(), move |uuid, _l| {
 | 
			
		||||
						if debug > 0 {
 | 
			
		||||
							println!("Schedule {} {}: {}",&it.name,&it.schedule,uuid);
 | 
			
		||||
						}
 | 
			
		||||
						tokio::spawn(async {run_cache_clouds().await});
 | 
			
		||||
					})?),
 | 
			
		||||
				_ => { 
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user