Reload configuration

This commit is contained in:
Difrex(Denis Zheleztsov) 2014-08-07 22:24:19 +04:00
parent e69a09d076
commit cdd87dff72

View File

@ -71,16 +71,19 @@ my $get = sub {
}; };
my $root = sub { my $root = sub {
$config = $c->reload();
my $index = $render->index($config); my $index = $render->index($config);
return [ 200, [ 'Content-type' => 'text/html' ], [$index], ]; return [ 200, [ 'Content-type' => 'text/html' ], [$index], ];
}; };
my $me = sub { my $me = sub {
$config = $c->reload();
my $messages = $render->to_me($config); my $messages = $render->to_me($config);
return [ 200, [ 'Content-type' => 'text/html' ], [$messages], ]; return [ 200, [ 'Content-type' => 'text/html' ], [$messages], ];
}; };
my $tree = sub { my $tree = sub {
$config = $c->reload();
my $subges = $render->tree($config); my $subges = $render->tree($config);
return [ 200, [ 'Content-type' => 'text/html' ], ['Дерево'], ]; return [ 200, [ 'Content-type' => 'text/html' ], ['Дерево'], ];
}; };
@ -118,7 +121,7 @@ my $enc = sub {
my $hash = $req->param('hash'); my $hash = $req->param('hash');
my $time = time(); my $time = time();
print Dumper($config); $config = $c->reload();
my $data = { my $data = {
echo => $echo, echo => $echo,
to => $to, to => $to,
@ -151,6 +154,7 @@ my $push = sub {
my $base64 = $req->param('base64'); my $base64 = $req->param('base64');
my $hash = $req->param('hash'); my $hash = $req->param('hash');
$config = $c->reload();
my $s = II::Send->new( $config, $echo, $base64 ); my $s = II::Send->new( $config, $echo, $base64 );
$s->send($hash); $s->send($hash);