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