mirror of
https://github.com/ohwgiles/laminar.git
synced 2026-11-02 08:34:44 +00:00
resolves #34: watch for configuration changes
Reload the configuration if a change is detected without requiring a server restart
This commit is contained in:
@@ -364,6 +364,8 @@ void Laminar::run() {
|
||||
const char* listen_http = getenv("LAMINAR_BIND_HTTP") ?: INTADDR_HTTP_DEFAULT;
|
||||
|
||||
srv = new Server(*this, listen_rpc, listen_http);
|
||||
srv->addWatchPath(fs::path(fs::path(homeDir)/"cfg"/"nodes").string().c_str());
|
||||
srv->addWatchPath(fs::path(fs::path(homeDir)/"cfg"/"jobs").string().c_str());
|
||||
srv->start();
|
||||
}
|
||||
|
||||
@@ -530,6 +532,13 @@ void Laminar::reapChildren() {
|
||||
assignNewJobs();
|
||||
}
|
||||
|
||||
void Laminar::notifyConfigChanged()
|
||||
{
|
||||
loadConfiguration();
|
||||
// config change may allow stuck jobs to dequeue
|
||||
assignNewJobs();
|
||||
}
|
||||
|
||||
void Laminar::abortAll() {
|
||||
for(std::shared_ptr<Run> run : activeJobs) {
|
||||
run->abort();
|
||||
|
||||
Reference in New Issue
Block a user