config cache issues

By default the configuration cached by the mod_perl2 instance.
You can disable cache by setting cache/config=0.
You should disable cache only if you have multiple calcms instances
running on the same mod_perl2 server with different configuration.

The Location of the configuration will be determined by config module
now.
This commit is contained in:
Milan
2018-09-22 21:39:20 +02:00
parent e043493847
commit afa56e9e1e
12 changed files with 303 additions and 293 deletions

View File

@@ -1,6 +1,5 @@
#! /usr/bin/perl -w
#use utf8;
use warnings "all";
use strict;
@@ -10,7 +9,6 @@ $CGI::DISABLE_UPLOADS = 1;
use Data::Dumper;
#use Apache2::Request;
use JSON();
use params();
use config();
@@ -19,37 +17,36 @@ use playout();
my $r = shift;
#binmode STDOUT, ":utf8";
binmode STDOUT, ":encoding(UTF-8)";
if ( $0 =~ /upload_playout.*?\.cgi$/ ) {
# read POST content
my ( $buf, $content );
while ( $r->read( $buf, 8192 ) ) {
$content .= $buf;
}
$content = "{}" unless $content;
# read POST content
my ( $buf, $content );
while ( $r->read( $buf, 8192 ) ) {
$content .= $buf;
}
$content = "{}" unless $content;
# parse GET content
( my $cgi, my $params, my $error ) = params::get($r);
# parse GET content
( my $cgi, my $params, my $error ) = params::get($r);
my $config = config::get('config/config.cgi');
my $debug = $config->{system}->{debug};
my $len = $r->headers_in()->get('Content-Length');
print "Content-type:text/plain\n\n";
my $config = config::getFromScriptLocation();
my $debug = $config->{system}->{debug};
my $len = $r->headers_in()->get('Content-Length');
print "Content-type:text/plain\n\n";
my $json = JSON::decode_json($content);
$json->{project_id} = $params->{project_id} if defined $params->{project_id};
$json->{studio_id} = $params->{studio_id} if defined $params->{studio_id};
$config->{access}->{write} = 1;
my $result = playout::sync( $config, $json );
$config->{access}->{write} = 0;
my $json = JSON::decode_json($content);
$json->{project_id} = $params->{project_id} if defined $params->{project_id};
$json->{studio_id} = $params->{studio_id} if defined $params->{studio_id};
$config->{access}->{write} = 1;
my $result = playout::sync( $config, $json );
$config->{access}->{write} = 0;
#print Dumper($content)."\n";
#print Dumper($r);
#print Dumper($json);
print "upload playout result:" . Dumper($result);
#print Dumper($content)."\n";
#print Dumper($r);
#print Dumper($json);
print "upload playout result:" . Dumper($result);
}
1;