websocket-gateway copy updates to init
This commit is contained in:
parent
0476e5ebb6
commit
2459b3d447
|
|
@ -95,7 +95,8 @@ module JamWebsockets
|
||||||
|
|
||||||
# this thread runs forever while WSG runs, and should do anything easily gotten out of critical message handling path
|
# this thread runs forever while WSG runs, and should do anything easily gotten out of critical message handling path
|
||||||
@background_thread = Thread.new {
|
@background_thread = Thread.new {
|
||||||
count = 0
|
client_check_count = 0
|
||||||
|
user_last_seen_count = 0
|
||||||
|
|
||||||
while true
|
while true
|
||||||
|
|
||||||
|
|
@ -103,11 +104,17 @@ module JamWebsockets
|
||||||
periodical_check_connections
|
periodical_check_connections
|
||||||
periodical_notification_seen
|
periodical_notification_seen
|
||||||
|
|
||||||
if count == 30
|
if client_check_count == 30
|
||||||
periodical_check_clients
|
periodical_check_clients
|
||||||
count = 0
|
client_check_count = 0
|
||||||
end
|
end
|
||||||
count = count + 1
|
client_check_count = client_check_count + 1
|
||||||
|
|
||||||
|
if user_last_seen_count == 120
|
||||||
|
periodical_update_user_last_seen
|
||||||
|
user_last_seen_count = 0
|
||||||
|
end
|
||||||
|
user_last_seen_count = user_last_seen_count + 1
|
||||||
|
|
||||||
rescue => e
|
rescue => e
|
||||||
@log.error "unhandled error in thread #{e}"
|
@log.error "unhandled error in thread #{e}"
|
||||||
|
|
@ -116,7 +123,7 @@ module JamWebsockets
|
||||||
sleep 1
|
sleep 1
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def start(connect_time_stale_client, connect_time_expire_client, connect_time_stale_browser, connect_time_expire_browser, options={:host => "localhost", :port => 5672, :max_connections_per_user => 10, :gateway => 'default', :allow_dynamic_registration => true, :chat_enabled => true, :chat_blast => true}, &block)
|
def start(connect_time_stale_client, connect_time_expire_client, connect_time_stale_browser, connect_time_expire_browser, options={:host => "localhost", :port => 5672, :max_connections_per_user => 10, :gateway => 'default', :allow_dynamic_registration => true, :chat_enabled => true, :chat_blast => true}, &block)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue