mirror of
https://github.com/OpenNebula/one.git
synced 2025-01-12 09:17:41 +03:00
M #-: Test monitor_expiration time as <= (#1605)
* Synchronize monitor_expiration semantics: <= 0 means monitoring disabled * VMRPCPool::get_monitoring minor optimization, no need to call SQL querry if monitoring disabled
This commit is contained in:
parent
c440bc9af7
commit
e3a89e964e
@ -66,7 +66,7 @@ int HostRPCPool::update_monitoring(const HostMonitoringTemplate& monitoring)
|
||||
|
||||
int HostRPCPool::clean_expired_monitoring()
|
||||
{
|
||||
if (monitor_expiration == 0)
|
||||
if (monitor_expiration <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -66,6 +66,11 @@ int VMRPCPool::update_monitoring(const VirtualMachineMonitorInfo& monitoring)
|
||||
|
||||
bool VMRPCPool::get_monitoring(int vmid, VirtualMachineMonitorInfo& vm)
|
||||
{
|
||||
if (monitor_expiration <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
ostringstream cmd;
|
||||
string monitor_str;
|
||||
|
||||
@ -126,7 +131,7 @@ int VMRPCPool::get_vmid(const string& deploy_id)
|
||||
|
||||
int VMRPCPool::clean_expired_monitoring()
|
||||
{
|
||||
if (monitor_expiration == 0)
|
||||
if (monitor_expiration <= 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user