1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2025-02-20 01:50:04 +00:00

disable sync if connect fail

This commit is contained in:
nishiki 2014-01-15 20:16:14 +01:00
parent 213743bad2
commit 90086f3262

View file

@ -39,6 +39,10 @@ class Sync
end end
def get(gpg_password) def get(gpg_password)
if !@sync
return nil
end
send_msg = {:action => 'get', send_msg = {:action => 'get',
:gpg_key => @gpg_key, :gpg_key => @gpg_key,
:password => @password, :password => @password,
@ -72,6 +76,10 @@ class Sync
end end
def update(data) def update(data)
if !@sync
return true
end
send_msg = {:action => 'update', send_msg = {:action => 'update',
:gpg_key => @gpg_key, :gpg_key => @gpg_key,
:password => @password, :password => @password,
@ -99,6 +107,10 @@ class Sync
end end
def close() def close()
if !@sync
return
end
send_msg = {:action => 'close'} send_msg = {:action => 'close'}
@socket.puts send_msg.to_json @socket.puts send_msg.to_json
end end