Compare commits
2 Commits
e6f702a6b4
...
8810679fd8
Author | SHA1 | Date | |
---|---|---|---|
8810679fd8 | |||
9d5815ed10 |
@ -81,10 +81,12 @@ class Application(BaseApplication):
|
||||
async def task_runner(self):
|
||||
while True:
|
||||
task = await self.tasks.get()
|
||||
self.db.begin()
|
||||
try:
|
||||
await task
|
||||
except Exception as ex:
|
||||
print(ex)
|
||||
self.db.commit()
|
||||
|
||||
async def prepare_database(self,app):
|
||||
self.db.query("PRAGMA journal_mode=WAL")
|
||||
|
@ -203,9 +203,7 @@ class RPCView(BaseView):
|
||||
if msg.type == web.WSMsgType.TEXT:
|
||||
try:
|
||||
async with Profiler():
|
||||
self.app.db.begin()
|
||||
await rpc(msg.json())
|
||||
self.app.db.commit()
|
||||
except Exception as ex:
|
||||
print(ex, flush=True)
|
||||
await self.services.socket.delete(ws)
|
||||
|
Loading…
Reference in New Issue
Block a user