Containerizing things.
	
		
			
	
		
	
	
		
			
				
	
				ci/woodpecker/push/woodpecker Pipeline failed
				
					Details
				
			
		
	
				
					
				
			
				
	
				ci/woodpecker/push/woodpecker Pipeline failed
				
					Details
				
			
		
	This commit is contained in:
		
							parent
							
								
									dd2c809177
								
							
						
					
					
						commit
						0bbdf1af02
					
				
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										4
									
								
								main.go
								
								
								
								
							
							
						
						
									
										4
									
								
								main.go
								
								
								
								
							|  | @ -58,6 +58,7 @@ func main() { | |||
| 	} | ||||
| 
 | ||||
| 	for { | ||||
| 		log.Println("Fetching and monitoring containers...") | ||||
| 		err := fetchAndMonitorContainers() | ||||
| 		if err != nil { | ||||
| 			log.Printf("Error in fetching and monitoring containers: %v", err) | ||||
|  | @ -72,6 +73,7 @@ func fetchAndMonitorContainers() error { | |||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
| 	log.Printf("Fetched %d containers\n", len(containers)) | ||||
| 
 | ||||
| 	for _, container := range containers { | ||||
| 		mu.Lock() | ||||
|  | @ -87,6 +89,7 @@ func fetchAndMonitorContainers() error { | |||
| 				Info:        container, | ||||
| 				LastChecked: time.Now().Add(-interval), | ||||
| 			} | ||||
| 			log.Printf("Started monitoring container %s (%s) with interval %s\n", container.Name, container.ID, container.Interval) | ||||
| 		} | ||||
| 		mu.Unlock() | ||||
| 	} | ||||
|  | @ -106,6 +109,7 @@ func fetchAndMonitorContainers() error { | |||
| 			if time.Since(mc.LastChecked) >= interval { | ||||
| 				mc.LastChecked = time.Now() | ||||
| 				mu.Unlock() | ||||
| 				log.Printf("Checking container %s (%s)\n", mc.Info.Name, mc.Info.ID) | ||||
| 				checkAndNotify(mc.Info) | ||||
| 			} else { | ||||
| 				mu.Unlock() | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue