diff --git a/README.md b/README.md index 961d6ab..99a1e53 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Lazytainer +# Lazytainer - Lazy Load Containers Putting your containers to sleep *I don't really wanna do the work today* @@ -27,7 +27,7 @@ $ docker-compose up - LABEL=lazytainer # value of lazytainer.marker for other containers that lazytainer checks # - TIMEOUT=30 # OPTIONAL number of seconds to let container idle # - MINPACKETTHRESH=10 # OPTIONAL number of packets that must be recieved to keepalive/start container - # - POLLRATE=1 # OPTIONAL number of packets that must be recieved to keepalive/start container + # - POLLRATE=1 # OPTIONAL number of seconds to sleep between polls # - VERBOSE=true # probably set this to false unless you're debugging or doing the initial demo ports: - 81:81 diff --git a/docker-compose.yaml b/docker-compose.yaml index c62c8a1..67a27b7 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,7 +8,7 @@ services: - LABEL=lazytainer # value of lazytainer.marker for other containers that lazytainer checks - TIMEOUT=30 # OPTIONAL number of seconds to let container idle - MINPACKETTHRESH=10 # OPTIONAL number of packets that must be recieved to keepalive/start container - - POLLRATE=1 # OPTIONAL number of packets that must be recieved to keepalive/start container + - POLLRATE=1 # OPTIONAL number of seconds to sleep between polls - VERBOSE=true # probably set this to false unless you're debugging or doing the initial demo ports: - 81:81 diff --git a/lazytainer.go b/lazytainer.go index 0016c8e..a8a73ce 100644 --- a/lazytainer.go +++ b/lazytainer.go @@ -36,7 +36,7 @@ func main() { if getActiveClients() == 0 && rxHistory[0]+minPacketThreshold > rxHistory[len(rxHistory)-1] { // count up if we have no active clients inactiveSeconds = inactiveSeconds + pollRate - fmt.Println(inactiveSeconds, "/", inactiveTimeout, "seconds without an active client") + fmt.Println(inactiveSeconds, "/", inactiveTimeout, "seconds without an active client or sufficient traffic on running container") if inactiveSeconds >= inactiveTimeout { stopContainers() }