Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Restart if unhealthy for more than x mins? #78

Open
edrock200 opened this issue Dec 31, 2021 · 4 comments
Open

Question: Restart if unhealthy for more than x mins? #78

edrock200 opened this issue Dec 31, 2021 · 4 comments

Comments

@edrock200
Copy link

Is it possible to configure autoheal to restart only if container is unhealthy for more than x mins? I have a container which has a db optimize routine which can sometimes make the container unresponsive and trigger an "unhealthy" state for a few minutes. As soon as it's done, the container goes healthy. Is there a way to tell autoheal "only restart if unhealthy for greater than x mins?" Thanks in advance.
Ed

@fracai
Copy link
Contributor

fracai commented Feb 11, 2022

Wouldn't it be more appropriate to set the health check configuration to only show unhealthy after those "few minutes"?
You have:

  • interval: how frequent
  • timeout: how long to wait for a response
  • retries: how many failures are required to be declared unhealthy
  • start-period: delay after startup before the first check

@edrock200
Copy link
Author

Understood, I don't think I will convince plex of changing it, but I'll give it a shot. :) Thanks again.

@RXWatcher
Copy link

RXWatcher commented Feb 24, 2022 via email

@edrock200
Copy link
Author

Oh I already have a script that does that, would just be nice to extend the timeout via autoheal. For others that want to do it it's just a simple bash script:

docker stop autoheal
curl -X PUT http://plexURL:32400/library/optimize?X-Plex-Token=plextoken
sleep 5m
docker start autoheal

Sub in your plex url and token and just cron that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants