teddycloud
teddycloud copied to clipboard
Function "Auto-Update tonies.json" does not update periodically
Function "Auto-Update tonies.json" does not update periodically
Tested on TeddyCloud v0.3.5 (8602da9) - 2024-01-22 13:39:05 +0000 linux-x86_64 on Docker
What was tested:
- Goto TeddyCloud webinterface and enable setting "Auto-Update tonies.json"
- Restart Container (done at 2024-01-23T07:30)
- Check Logs for auto-update entries after two days → Looks like 'tonies.json' was only updated after Container start.
What was expected:
I would expect an periodic update of the 'tonies.json' file (e.g. once a day) as the name of the settings "Auto-Update" tells.
Attached you can find the logs:
user@host:~# date
Thu Jan 25 11:08:38 AM CET 2024
user@host:~# docker logs --timestamps teddycloud 2>&1 | grep "tonies.json"
2024-01-23T07:30:23.819653378Z INFO |toniesJson.c:0057:tonies_update| Updating tonies.json from GitHub...
2024-01-23T07:30:24.161541749Z INFO |toniesJson.c:0079:tonies_update| ... success updating tonies.json from GitHub, reloading
2024-01-23T07:30:24.161621249Z INFO |toniesJson.c:0157:tonies_readJson| Trying to read /etc/teddycloud/config/tonies.json with size 4297501
This is currently only used on startup, as there is a service missing that checks it once a day.
Good to know. Then i will automatically restart my container as a workaround.
As an alternative, you may trigger /api/toniesJsonUpdate.
Good Hint. I read this a few minutes ago on Telegramm. This is less invasive. Thanks!
I would like to tackle this ticket @SciLor but would like to get your input before. I see two ways of achieving this:
- Use CRON inside of docker to run something like ./bin/teddycloud --update-tonies-json
- Spin off a thread from within the
server_init()function
What do you think? In my opinion, Option 1 is a little cleaner.
- Would be an easy win, but does not integrate with teddyCloud (config file) and may only work with the docker variant.
- Using a dedicated thread for that would be the way to go
@SciLor not sure if you already saw my PR and also not sure if it's what you are looking for. I had fun getting into the codebase though and am ready for feedback.
The solution looks fine and helpful for me, but it seems to be abandoned? @ceicke @SciLor ?
It didn’t get merged yet because the build for Windows failed and I have no idea how to fix it…