Merge pull request #428 from bachandi/inhibit_locking_env

Add option to disable rrd locking during cgi calls
This commit is contained in:
Jordi Sanfeliu 2022-07-22 09:00:38 +02:00 committed by GitHub
commit 99fbc51fc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -171,7 +171,7 @@ Default value: \fIy\fP
.P
.BI enable_rrd_lock
.RS
This option will synchronise the rrd file access by creating the file \fI/tmp/monitorix.lock\fP and use it via flock.
This option will synchronise the rrd file access by creating the file \fI/tmp/monitorix.lock\fP and use it via flock. The read lock during the cgi call can be disabled on a per call basis via setting the environment variable \fIINHIBIT_LOCKING\fP. This is useful for modules that call the cgi function internally.
.P
Default value: \fIn\fP
.RE

View File

@ -578,7 +578,7 @@ if($mode eq "localhost") {
my @writers; # array of file descriptors
my $children = 0;
my $lockfile_handler = lockfile_handler(\%config);
my $lockfile_handler = lockfile_handler(\%config) unless $ENV{INHIBIT_LOCKING};
global_flock($lockfile_handler, LOCK_SH);
foreach (split(',', $config{graph_name})) {
my $gn = trim($_);