mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Force modules that run once to async types.
This commit is contained in:
parent
1b3a12a8f0
commit
a29e504e2c
@ -1671,6 +1671,17 @@ sub parse_conf_modules($) {
|
|||||||
# Convert from seconds to actual agent intervals.
|
# Convert from seconds to actual agent intervals.
|
||||||
$module->{'interval'} = ceil($module->{'absoluteinterval'} / $Conf{'interval'});
|
$module->{'interval'} = ceil($module->{'absoluteinterval'} / $Conf{'interval'});
|
||||||
|
|
||||||
|
# Make sure modules that run once are asynchronous.
|
||||||
|
if ($module->{'interval'} == 0) {
|
||||||
|
if ($module->{'type'} eq 'generic_data') {
|
||||||
|
$module->{'type'} = 'async_data';
|
||||||
|
} elsif ($module->{'type'} eq 'generic_proc') {
|
||||||
|
$module->{'type'} = 'async_proc';
|
||||||
|
} elsif ($module->{'type'} eq 'generic_data_string') {
|
||||||
|
$module->{'type'} = 'async_string';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# This file will be used for persistence.
|
# This file will be used for persistence.
|
||||||
$module->{'timestamp_file'} = $ConfDir . '/' . $Conf{'server_path_ref'} . '/' . md5($module->{'name'}) . '.ref';
|
$module->{'timestamp_file'} = $ConfDir . '/' . $Conf{'server_path_ref'} . '/' . md5($module->{'name'}) . '.ref';
|
||||||
}
|
}
|
||||||
|
@ -1448,6 +1448,18 @@ Pandora_Module_Factory::getModuleFromDefinition (string definition) {
|
|||||||
numeric = false;
|
numeric = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure modules that run once are asynchronous.
|
||||||
|
if (module->getInterval() == 0) {
|
||||||
|
type = module->getTypeInt();
|
||||||
|
if (type == TYPE_GENERIC_DATA) {
|
||||||
|
module->setType("async_data");
|
||||||
|
} else if (type == TYPE_GENERIC_PROC) {
|
||||||
|
module->setType("async_proc");
|
||||||
|
} else if (type == TYPE_GENERIC_DATA_STRING) {
|
||||||
|
module->setType("async_string");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (numeric) {
|
if (numeric) {
|
||||||
if (module_max != "") {
|
if (module_max != "") {
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user