git://git.camperquake.de
/
videosite.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
JSJSONArrayParser: ignore garbage at end of JSON string
[videosite.git]
/
libvideosite.pm
diff --git
a/libvideosite.pm
b/libvideosite.pm
index
3f05160
..
c39d9e5
100644
(file)
--- a/
libvideosite.pm
+++ b/
libvideosite.pm
@@
-34,7
+34,7
@@
my $getter;
my %builtin_config = ();
my $builtin_config_path;
my $builtin_config_default;
my %builtin_config = ();
my $builtin_config_path;
my $builtin_config_default;
-my $config_cache =
0
;
+my $config_cache =
1
;
my %config_cache = ();
our $error;
my %config_cache = ();
our $error;
@@
-127,8
+127,8
@@
my $videosite_commands = {
_cmd_nodebug(@_);
},
_cmd_nodebug(@_);
},
- '
cach
e' => sub {
- _cmd_
cach
e(@_);
+ '
servic
e' => sub {
+ _cmd_
servic
e(@_);
},
};
},
};
@@
-931,9
+931,24
@@
sub _cmd_nodebug {
}
#
}
#
+# Handle generic service commands
+#
+sub _cmd_service {
+ my $event = shift;
+ my $subcmd = shift || '';
+
+ $subcmd = lc($subcmd);
+
+ if ($subcmd eq 'cache') {
+ _cmd_service_cache($event, @_);
+ }
+}
+
+
+#
# Display or clear the content of the config cache
#
# Display or clear the content of the config cache
#
-sub _cmd_cache {
+sub _cmd_
service_
cache {
my $event = shift;
my $subcmd = shift;
my $event = shift;
my $subcmd = shift;
@@
-944,14
+959,14
@@
sub _cmd_cache {
_io("Content of config cache:");
foreach (sort(keys(%config_cache))) {
if (exists($config_cache{$_}->{value})) {
_io("Content of config cache:");
foreach (sort(keys(%config_cache))) {
if (exists($config_cache{$_}->{value})) {
- _io("%s => %s", $_, $config_cache{$_}->{value});
+ _io("
%s => %s", $_, $config_cache{$_}->{value});
} else {
} else {
- _io("%s present", $_);
+ _io("
%s present", $_);
}
}
} elsif ($subcmd eq 'clear') {
}
}
} elsif ($subcmd eq 'clear') {
- _debug("Clearing config cache");
%config_cache = ();
%config_cache = ();
+ _io("Cache cleared");
}
}
}
}