Commit 01f7d2a4 authored by Cedric Caffy's avatar Cedric Caffy
Browse files

[cta-taped] The MaintenanceProcess can be disabled via its configuration file...

[cta-taped] The MaintenanceProcess can be disabled via its configuration file (DisableMaintenanceProcess)
parent 4aca9524
......@@ -112,8 +112,12 @@ void cta::tape::daemon::TapeDaemon::mainEventLoop() {
pm.addHandler(std::move(dh));
}
// Create the garbage collector
std::unique_ptr<MaintenanceHandler> gc(new MaintenanceHandler(m_globalConfiguration, pm));
pm.addHandler(std::move(gc));
if(!isMaintenanceProcessDisabled()){
std::unique_ptr<MaintenanceHandler> gc(new MaintenanceHandler(m_globalConfiguration, pm));
pm.addHandler(std::move(gc));
} else {
lc.log(log::INFO,"In TapeDaemon::mainEventLoop, the Maintenance process is disabled from the configuration. Will not run it.");
}
// And run the process manager
int ret=pm.run();
{
......@@ -157,4 +161,8 @@ void cta::tape::daemon::TapeDaemon::setProcessCapabilities(
}
}
bool cta::tape::daemon::TapeDaemon::isMaintenanceProcessDisabled() const{
return m_globalConfiguration.disableMaintenanceProcess.value() == "yes";
}
}}} // namespace cta::tape::daemon
......@@ -51,6 +51,9 @@ public:
* @return The return code of the process. */
int main();
private:
bool isMaintenanceProcessDisabled() const;
protected:
/** Enumeration of the possible tape-daemon states. */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment