Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
agkyra
Commits
d764f5b1
Commit
d764f5b1
authored
May 27, 2015
by
Stavros Sachtouris
Committed by
Giorgos Korfiatis
Oct 19, 2015
Browse files
Clean up DB when web protocol listener is closed
parent
c1b845fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
agkyra/protocol.py
View file @
d764f5b1
...
...
@@ -378,13 +378,15 @@ class WebSocketProtocol(WebSocket):
"""Stop server heart, empty DB and exit"""
LOG
.
debug
(
'Stop protocol heart'
)
self
.
heart
.
stop
()
self
.
clean_db
()
def
clean_db
(
self
):
"""Clean DB from session traces"""
LOG
.
debug
(
'Remove session traces'
)
self
.
db
=
sqlite3
.
connect
(
self
.
session_db
)
self
.
db
.
execute
(
'BEGIN'
)
self
.
db
.
execute
(
'DELETE FROM %s'
%
self
.
session_relation
)
self
.
db
.
commit
()
self
.
db
.
close
()
LOG
.
debug
(
'Helper: connection closed'
)
def
send_json
(
self
,
msg
):
LOG
.
debug
(
'send: %s'
%
msg
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment