Add logout call to server
This commit is contained in:
1 parent
93bbd23a78
commit
7366745dfb
1 file changed
+12
@@ -144,6 +144,18 @@ def login(username, password, host, port, database):
|
||||
def logout():
|
||||
global _SOCK, _USER, _USERNAME, _SESSION, _DATABASE, _VIEW_CACHE, SECURE
|
||||
if _SOCK:
|
||||
try:
|
||||
_SEMAPHORE.acquire()
|
||||
try:
|
||||
args = (_DATABASE, _USER, _SESSION, 'common', 'db', 'logout')
|
||||
logging.getLogger('rpc.request').info(repr(args))
|
||||
_SOCK.send(args)
|
||||
res = _SOCK.receive()
|
||||
logging.getLogger('rpc.result').debug(repr(res))
|
||||
finally:
|
||||
_SEMAPHORE.release()
|
||||
except:
|
||||
pass
|
||||
_SOCK.disconnect()
|
||||
_SOCK = None
|
||||
_USER = 0
|
||||
|
||||
Reference in new issue
Block a user