diff options
author | Rhenium <rhenium@rhe.jp> | 2013-07-29 05:32:08 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2013-07-29 05:32:08 +0900 |
commit | a170af32edc5f18bb4260fb81ef6c5ea885a5610 (patch) | |
tree | 7421a462bbeadd2e9fe4d7c76ea6a91b73b67ea1 /lib/aclog | |
parent | e2c42d9b4c4e5a5fd4a4b16744ff5973fc2d1095 (diff) | |
download | aclog-a170af32edc5f18bb4260fb81ef6c5ea885a5610.tar.gz |
deactivate
Diffstat (limited to 'lib/aclog')
-rw-r--r-- | lib/aclog/receiver/collector_connection.rb | 6 | ||||
-rw-r--r-- | lib/aclog/receiver/register_server.rb | 15 |
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/aclog/receiver/collector_connection.rb b/lib/aclog/receiver/collector_connection.rb index 3d441b1..8b566cc 100644 --- a/lib/aclog/receiver/collector_connection.rb +++ b/lib/aclog/receiver/collector_connection.rb @@ -28,6 +28,12 @@ module Aclog Rails.logger.debug("Sent #{account.id}/#{account.user_id}") end + def send_stop_account(account) + send_object(type: "stop", + id: account.id) + Rails.logger.debug("Sent Stop #{account.id}/#{account.user_id}") + end + def post_init # なにもしない。クライアントが end diff --git a/lib/aclog/receiver/register_server.rb b/lib/aclog/receiver/register_server.rb index 4f8a06c..541efd5 100644 --- a/lib/aclog/receiver/register_server.rb +++ b/lib/aclog/receiver/register_server.rb @@ -11,20 +11,15 @@ module Aclog con_num = account.id % Settings.collector.count con = @connections[con_num] if con - con.send_account(account) - Rails.logger.info("Sent account: connection_number: #{con_num} / account_id: #{account.id}") + if account.active? + con.send_account(account) + else + con.send_stop_account(account) + end else Rails.logger.info("Connection not found: connection_number: #{con_num} / account_id: #{account.id}") end end - - def unregister(account_) - account = Marshal.load(account_) - end - - def unregister(account) - # TODO - end end end end |