Skip to content

Commit 96a01b3

Browse files
authored
add process registration (Cacti#5457)
* add process registration * update
1 parent 24b5c72 commit 96a01b3

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ Cacti CHANGELOG
7171
-issue#5452: The default 'bulk_walk_size' is -1 which means a device will never find it's optimal bulk walk size
7272
-issue#5453: Templates without copyright, cleaning SNMP printer package
7373
-issue#5454: Cacti Orphan Graphs Selector missing column 'orphan' in SQL selector
74+
-issue#5457: Enable 'Re-Index All Device Schedule' causes a lot of reindex processes
7475
-feature#5375: Add template for Fortinet firewall and Aruba Instant cluster
7576
-feature#5393: Add template for SNMP printer
7677
-feature#5418: Display device class before package import

cli/poller_reindex_hosts.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,17 @@
152152
print 'WARNING: Do not interrupt this script. Reindexing can take quite some time' . PHP_EOL;
153153
debug("There are '" . cacti_sizeof($data_queries) . "' data queries to run");
154154

155+
156+
/* silently end if the registered process is still running */
157+
if (!$force) {
158+
if (!register_process_start('reindex', 'master', 0, 86400)) {
159+
print "FATAL: Detected an already running process. Use --force to override" . PHP_EOL;
160+
exit(0);
161+
}
162+
}
163+
164+
165+
155166
$i = 1;
156167
$total_start = microtime(true);
157168
if (cacti_sizeof($data_queries)) {
@@ -195,6 +206,9 @@
195206

196207
$i++;
197208
}
209+
210+
unregister_process('reindex', 'master');
211+
198212
}
199213

200214
function display_version() {

0 commit comments

Comments
 (0)