summaryrefslogtreecommitdiffstats
path: root/clerk_rating_client
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-09-23 19:05:12 +0200
committerRasmus Steinke <rasi@xssn.at>2017-09-23 19:05:12 +0200
commitb0d06806a493b464554ade91b9342dbd1f575543 (patch)
treefa7f5deedd7555455b6cdaad2b82358ab4bfb1c6 /clerk_rating_client
parent36c4c3f9009404993c7c373e5dad9765ca6c3092 (diff)
downloadperl-app-clerk-b0d06806a493b464554ade91b9342dbd1f575543.tar.gz
perl-app-clerk-b0d06806a493b464554ade91b9342dbd1f575543.tar.xz
subscribe again if lost
Diffstat (limited to 'clerk_rating_client')
-rwxr-xr-xclerk_rating_client5
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) {