work on cliui
This commit is contained in:
parent
9fd985ea49
commit
c142ab770a
2 changed files with 28 additions and 9 deletions
|
|
@ -377,18 +377,21 @@ class Core:
|
|||
'''
|
||||
Add a command to the daemon queue, used by the communication daemon (communicator.py)
|
||||
'''
|
||||
retData = True
|
||||
# Intended to be used by the web server
|
||||
date = self._utils.getEpoch()
|
||||
conn = sqlite3.connect(self.queueDB)
|
||||
c = conn.cursor()
|
||||
t = (command, data, date)
|
||||
c.execute('INSERT INTO commands (command, data, date) VALUES(?, ?, ?)', t)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
|
||||
try:
|
||||
c.execute('INSERT INTO commands (command, data, date) VALUES(?, ?, ?)', t)
|
||||
conn.commit()
|
||||
conn.close()
|
||||
except sqlite3.OperationalError:
|
||||
retData = False
|
||||
events.event('queue_push', data = {'command': command, 'data': data}, onionr = None)
|
||||
|
||||
return
|
||||
return retData
|
||||
|
||||
def clearDaemonQueue(self):
|
||||
'''
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue