diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-09-23 19:01:35 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-09-23 19:01:35 +0200 |
commit | 36c4c3f9009404993c7c373e5dad9765ca6c3092 (patch) | |
tree | a43d67f298b91117db11867e8cd80556ca65cd1d /clerk_rating_client | |
parent | b79390298a0f3e49036aea869f27faa59f692ba3 (diff) | |
download | perl-app-clerk-36c4c3f9009404993c7c373e5dad9765ca6c3092.tar.gz perl-app-clerk-36c4c3f9009404993c7c373e5dad9765ca6c3092.tar.xz |
open connection first
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-x | clerk_rating_client | 3 |
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) { |