X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=libvideosite.pm;h=c39d9e5c79b8cd8bfdffadeb41810440c9f64028;hb=eeddf244ed2b5c9cde3bda1f264f6b0bd8155bb3;hp=34191b8ac73bca426c04f8c1d6f8046bceb5c3b4;hpb=39767f785076ce64d831cbfbc7f51cc2af5ef22d;p=videosite.git diff --git a/libvideosite.pm b/libvideosite.pm index 34191b8..c39d9e5 100644 --- a/libvideosite.pm +++ b/libvideosite.pm @@ -127,8 +127,8 @@ my $videosite_commands = { _cmd_nodebug(@_); }, - 'cache' => sub { - _cmd_cache(@_); + 'service' => sub { + _cmd_service(@_); }, }; @@ -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 # -sub _cmd_cache { +sub _cmd_service_cache { 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("%s => %s", $_, $config_cache{$_}->{value}); + _io(" %s => %s", $_, $config_cache{$_}->{value}); } else { - _io("%s present", $_); + _io(" %s present", $_); } } } elsif ($subcmd eq 'clear') { - _debug("Clearing config cache"); %config_cache = (); + _io("Cache cleared"); } }