Control Center won't start when the log directory is empty and it expects logs to arrive via rsync
Version: 1.7.1, from the official docker image.
When I am using a new instance of Control Center that receives logs via rsync (LIGHTMETER_LOGS_USE_RSYNC=true
or -logs_use_rsync
), and there aren't any logs there yet, I expect the application to start (instead of failing as it currently does) and to keep on the "importing insights" state until the logs appear on the first rsync execution.
Implemention-wise this can be done by watching the logs directory for changes (via inotify) and keep waiting while it's empty. Once we realize all the logs in the first rsync "round" have been synchronized, we move to the "running" state.
One big issue is that we cannot guarantee the order the files generate by rsync appear in the filesystem, but we can rely on the fact that they seem to appear in a single "shot", meaning that they are changed in relatively easily identifiable "batches".
This feature will be needed to allow users to create new instances automatically in the SaaS setup.