cbrain icon indicating copy to clipboard operation
cbrain copied to clipboard

Add ability to force a reload of a descriptor in the new integrator

Open prioux opened this issue 3 years ago • 2 comments

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:

  1. Maybe a new Control message could be sent to a Bourreau do perform the same reload
  2. Descriptors loaded by the integrator have from_file() method that is useful
  3. The admin must realize that eloading won't affect existing ToolConfigs and Tools (e.g. their container config attributes)

prioux avatar Nov 18 '21 17:11 prioux

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.

prioux avatar Nov 18 '21 17:11 prioux

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.

prioux avatar Nov 19 '21 00:11 prioux