one sqlalchemy session per thread
This commit is contained in:
parent
0c08d37c56
commit
8b46a85d56
15 changed files with 140 additions and 102 deletions
|
|
@ -245,8 +245,8 @@ def sortLists(data):
|
|||
n += 1
|
||||
if l.type == 'static':
|
||||
lists.append(l.name)
|
||||
models.db.session.add(l)
|
||||
models.db.session.commit()
|
||||
state.db.session.add(l)
|
||||
state.db.session.commit()
|
||||
if lists:
|
||||
Changelog.record(state.user(), 'orderlists', lists)
|
||||
return {}
|
||||
|
|
@ -287,8 +287,8 @@ def sortUsers(data):
|
|||
u = models.User.get(id)
|
||||
u.info['index'] = n
|
||||
n += 1
|
||||
models.db.session.add(u)
|
||||
models.db.session.commit()
|
||||
state.db.session.add(u)
|
||||
state.db.session.commit()
|
||||
return {}
|
||||
actions.register(sortUsers, cache=False)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue