Containerizing things.
ci/woodpecker/push/woodpecker Pipeline failed Details

This commit is contained in:
Colin 2024-06-12 17:16:01 -04:00
parent dd2c809177
commit 0bbdf1af02
8 changed files with 4 additions and 0 deletions

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.

View File

@ -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()