diff --git a/lib/CF.pm b/lib/CF.pm index 5293b285123ecc8817c454ed6bbf80354d770390..a1fb659afaa48af3283ffc0505fc9c3dba7000fc 100644 --- a/lib/CF.pm +++ b/lib/CF.pm @@ -91,7 +91,6 @@ sub startup { my $r = $self->routes; $r->get('/')->to(cb => sub { shift->redirect_to('/api.html');}); - $r->websocket('/ws/posts')->to('Posts#ws'); $r->websocket('/ws')->to('Websockets#main'); } diff --git a/lib/CF/Controller/Posts.pm b/lib/CF/Controller/Posts.pm index da2a18e1272a0d3a23a047e5702cf62aee639466..e90e791dcc58d9a89ab8c469f07ac9601dbdcf02 100644 --- a/lib/CF/Controller/Posts.pm +++ b/lib/CF/Controller/Posts.pm @@ -180,15 +180,6 @@ sub update ($c) { changed => \'now()', }); - # TODO: vyhodit - $pubsub->json('posts')->notify( posts => { - event => 'changed', - payload => { - id => $post->id, - %{ $update }, - } - }); - $pubsub->json('notify')->notify( notify => { event => 'post_changed', payload => { @@ -254,15 +245,6 @@ sub ranking ($c) { }); } - # TODO: vyhodit - $pubsub->json('posts')->notify(posts => { - event => 'ranked', - payload => { - id => $post->id, - %{ $update }, - } - }); - $pubsub->json('notify')->notify(notify => { event => 'post_ranked', payload => { @@ -275,22 +257,4 @@ sub ranking ($c) { $c->render(status => 204, text => ''); } -# TODO: vyhodit -sub ws { - my $c = shift; - - $c->inactivity_timeout(600); - - my $pubsub = Mojo::Pg::PubSub->new(pg => $c->pg); - - $pubsub->listen(posts => sub($pubsub, $payload) { - $c->send($payload); - }); - - $c->on(finish => sub ($c, $code, $reason = undef) { - $pubsub->unlisten('streams'); - $c->app->log->debug("WebSocket closed with status $code"); - }); -} - 1;