cbrain
cbrain copied to clipboard
Add ability to force a reload of a descriptor in the new integrator
This is just a feature, but given that the new integrator stores descriptors in memory at boot time, maybe having the ability to force a reload of all of them (just replacing their content) would be nice. This would allow the admin to edit a descriptor in the installation, click the reload button and then the new descriptor takes effect. Maybe an admin feature in the interface somewhere.
Notes:
- Maybe a new Control message could be sent to a Bourreau do perform the same reload
- Descriptors loaded by the integrator have
from_file()
method that is useful - The admin must realize that eloading won't affect existing ToolConfigs and Tools (e.g. their container config attributes)
While I was writing this, I realized that we should just reload them all, not have an option to reload any one in particular. There's not big cost anyway.
I've just had a brilliant idea.
Add to BoutiquesSupport::BoutiquesDescriptor a new internal attribute 'mtime_of_file' and add a new method called 'reload_if_file_timestamp_changed()'. Then the ToolConfig descriptor cache will just invoke the method whenever it's asked for a descriptor and update it if it finds the file on the filesystem has a new mtime .
That means automatic descriptor reloading if it changes on disk.