diff options
author | Rasmus Steinke <rasi@xssn.at> | 2017-09-23 19:05:12 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2017-09-23 19:05:12 +0200 |
commit | b0d06806a493b464554ade91b9342dbd1f575543 (patch) | |
tree | fa7f5deedd7555455b6cdaad2b82358ab4bfb1c6 /clerk_rating_client | |
parent | 36c4c3f9009404993c7c373e5dad9765ca6c3092 (diff) | |
download | perl-app-clerk-b0d06806a493b464554ade91b9342dbd1f575543.tar.gz perl-app-clerk-b0d06806a493b464554ade91b9342dbd1f575543.tar.xz |
subscribe again if lost
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-x | clerk_rating_client | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clerk_rating_client b/clerk_rating_client index 20debc0..f846f3e 100755 --- a/clerk_rating_client +++ b/clerk_rating_client @@ -40,13 +40,14 @@ sub main { } sub subscribe_ratings_channel { + try { $mpd->close(); }; + $mpd->{socket}->close; $mpd->subscribe('rating'); } sub track_rating { while(1) { - try { $mpd->close(); }; - $mpd->{socket}->close; + subscribe_ratings_channel(); $mpd->idle('message'); my @blub = $mpd->read_messages; foreach (@blub) { |