1
0
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:
Pavel Czerný 2021-11-23 16:19:14 +01:00 committed by GitHub
parent c440bc9af7
commit e3a89e964e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}