sablierapp / sablier

Start your containers on demand, shut them down automatically when there's no activity. Docker, Docker Swarm Mode and Kubernetes compatible.
https://sablierapp.dev/
GNU Affero General Public License v3.0
1.36k stars 46 forks source link

DynamicStrategy RefreshFrequency is hardcoded to 5s #175

Closed patcher-ms closed 1 year ago

patcher-ms commented 1 year ago

Describe the bug I noticed that if even if change the refresh frequency in the configuration the template refreshes after 5 seconds. I believe this is due to this value being hardcoded to 5s https://github.com/acouvreur/sablier/blob/5ab29c3cccef91ae8dd0406da88549b636beb79d/app/http/routes/strategies.go#L90

Context

Expected behavior I would expect that changing Sablier's configuration

strategy:
  dynamic:
    default-refresh-frequency: 1s

or setting the refresh frequency in a label (e.g. traefik.http.middlewares.grafana.plugin.sablier.dynamic.refreshFrequency=10s) would result in a response with the refresh frequency I configured.

Additional context All the other values I configured are picked up correctly so I don't this this is a misconfiguration on my side. I am not using health checks on the Docker container which could hide the issue since an health check would prevent a pod from being detected as up until the service is actually ready.

acouvreur commented 1 year ago

Will look it up, seems easy to fix

acouvreur commented 1 year ago

:tada: This issue has been resolved in version 1.4.0-beta.6 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

patcher-ms commented 1 year ago

Thanks for looking into this so quickly.

Unfortunately I am still having a couple issues:

acouvreur commented 1 year ago

I'll take a look, but the value should be retrieved from the configuration first as a default value, and then overwritten by the body

acouvreur commented 1 year ago

:tada: This issue has been resolved in version 1.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: