From c5c22a6b687568fb5ffa498fb36c99f0f7eb36b4 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Fri, 4 Nov 2016 00:09:05 +0100 Subject: [PATCH] To not stream threads at once (module require issue). --- app/models/channel.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/models/channel.rb b/app/models/channel.rb index 28e22bf66..b56a8e68e 100644 --- a/app/models/channel.rb +++ b/app/models/channel.rb @@ -159,10 +159,13 @@ stream all accounts updated_at: channel.updated_at } + # start channels with delay + sleep @@channel_stream.count + # start threads for each channel @@channel_stream[channel.id][:thread] = Thread.new { begin - logger.debug "Started stream channel for '#{channel.id}' (#{channel.area})..." + logger.info "Started stream channel for '#{channel.id}' (#{channel.area})..." @@channel_stream[channel.id][:stream_instance] = channel.stream_instance @@channel_stream[channel.id][:stream_instance].stream @@channel_stream[channel.id][:stream_instance].disconnect