Reload configuration without restarting process #10922
-
Is it possible for the shields server to reload configuration from its yaml file without restarting? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Is this for local dev or when deployed? |
Beta Was this translation helpful? Give feedback.
-
A few thoughts.. Reloading on changesIf you wanted to run a version of shields that does reload on changes to files, you could make your own Dockerfile that does something different here Line 34 in be9cdc2 Token poolI suspect the token pool probably wouldn't do what you need for several reasons.
In theory there is nothing that stops self-hosting users from using the token pool, but in reality is something that is quite tailored to our specific production needs for shields.io itself. App tokensFinally, if you want to run shields without a PAT, I think the next thing I would look at is whether app tokens will work for the badges that use the GraphQL API and/or badges that are not specifically tied to a repo/org. I've never tried running shields with app tokens, but I suspect you might run into something like this problem #8792 so probably best check that first locally to prove the concept before wasting a lot of time on it. |
Beta Was this translation helpful? Give feedback.
Actually, I will just answer for both cases.
For production usage, docker image, etc we just run
node server.js
which doesn't do any kind of monitoring or reloading. For stability and predictability of service, this is a good thing and I don't think we should change it.For local dev, we do hot reloads with nodemon. https://www.npmjs.com/package/nodemon By default it doesn't look at yaml files so that's probably why it doesn't reload the dev server when settings are changed. I've not tested, but I reckon we could probably tell nodemon to also monitor yaml files and that would also give us hot reload on settings in local dev. If you have a go at that and it works, feel free to PR it.