implement quit api. indicate if backend is offline
This commit is contained in:
parent
67ad0a82e9
commit
5d4ed8ffbc
8 changed files with 83 additions and 35 deletions
18
oml/api.py
18
oml/api.py
|
|
@ -9,7 +9,6 @@ import os
|
|||
import ox
|
||||
from oxtornado import actions
|
||||
|
||||
|
||||
import item.api
|
||||
import user.api
|
||||
import update
|
||||
|
|
@ -77,3 +76,20 @@ def autocompleteFolder(data):
|
|||
'items': ox.sorted_strings(folders)
|
||||
}
|
||||
actions.register(autocompleteFolder, cache=False)
|
||||
|
||||
def quit(data):
|
||||
'''
|
||||
takes {
|
||||
}
|
||||
returns {
|
||||
}
|
||||
'''
|
||||
'''
|
||||
import server
|
||||
server.shutdown()
|
||||
'''
|
||||
import settings
|
||||
subprocess.Popen([os.path.join(settings.base_dir, 'ctl'), 'stop'],
|
||||
close_fds=True, start_new_session=True)
|
||||
return {}
|
||||
actions.register(quit, cache=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue