We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b96fba0 commit a6ee823Copy full SHA for a6ee823
src/healthcheck.go
@@ -0,0 +1,19 @@
1
+package main
2
+
3
+import (
4
+ "fmt"
5
+ "log"
6
+ "net/http"
7
+)
8
9
+func handler(w http.ResponseWriter, r *http.Request) {
10
+ fmt.Fprintf(w, "compose-updater online")
11
+}
12
13
+func Healthcheck() {
14
+ http.HandleFunc("/", handler)
15
+ log.Println("Starting healthcheck server at port 8080...")
16
+ if err := http.ListenAndServe(":8080", nil); err != nil {
17
+ log.Println(err)
18
+ }
19
src/main.go
@@ -30,6 +30,7 @@ func printHeader() {
30
31
func mainLoop() {
32
updater := &Updater{}
33
+ go Healthcheck();
34
for {
35
updater.PerformComposeUpdates()
36
if GlobalSettings.Once {
0 commit comments