summaryrefslogtreecommitdiffstats
path: root/clerk_rating_client
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-09-23 19:01:35 +0200
committerRasmus Steinke <rasi@xssn.at>2017-09-23 19:01:35 +0200
commit36c4c3f9009404993c7c373e5dad9765ca6c3092 (patch)
treea43d67f298b91117db11867e8cd80556ca65cd1d /clerk_rating_client
parentb79390298a0f3e49036aea869f27faa59f692ba3 (diff)
downloadperl-app-clerk-36c4c3f9009404993c7c373e5dad9765ca6c3092.tar.gz
perl-app-clerk-36c4c3f9009404993c7c373e5dad9765ca6c3092.tar.xz
open connection first
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-xclerk_rating_client3
1 files changed, 3 insertions, 0 deletions
diff --git a/clerk_rating_client b/clerk_rating_client
index a00de29..20debc0 100755
--- a/clerk_rating_client
+++ b/clerk_rating_client
@@ -5,6 +5,7 @@ use v5.10;
use warnings;
use Array::Utils qw(:all);
#use DDP;
+use Try::Tiny;
use Config::Simple;
use File::Spec;
use strict;
@@ -44,6 +45,8 @@ sub subscribe_ratings_channel {
sub track_rating {
while(1) {
+ try { $mpd->close(); };
+ $mpd->{socket}->close;
$mpd->idle('message');
my @blub = $mpd->read_messages;
foreach (@blub) {