1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-10-27 10:43:20 +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
def get(gpg_password)
if !@sync
return nil
end
send_msg = {:action => 'get',
:gpg_key => @gpg_key,
:password => @password,
@ -72,6 +76,10 @@ class Sync
end
def update(data)
if !@sync
return true
end
send_msg = {:action => 'update',
:gpg_key => @gpg_key,
:password => @password,
@ -99,6 +107,10 @@ class Sync
end
def close()
if !@sync
return
end
send_msg = {:action => 'close'}
@socket.puts send_msg.to_json
end