mirror of
https://github.com/simple-login/app.git
synced 2025-09-04 13:44:23 +08:00
Rollback session
This commit is contained in:
parent
794bb28990
commit
2aac58f792
1 changed files with 6 additions and 1 deletions
|
@ -8,6 +8,7 @@ from typing import List, Optional
|
|||
|
||||
import arrow
|
||||
import newrelic.agent
|
||||
from sqlalchemy.exc import IntegrityError
|
||||
from sqlalchemy.orm import Query
|
||||
from sqlalchemy.orm.exc import ObjectDeletedError
|
||||
from sqlalchemy.sql.expression import or_, and_
|
||||
|
@ -403,4 +404,8 @@ def execute():
|
|||
if __name__ == "__main__":
|
||||
send_version_event("job_runner")
|
||||
while True:
|
||||
execute()
|
||||
try:
|
||||
execute()
|
||||
except IntegrityError:
|
||||
Session.rollback()
|
||||
Session.close()
|
||||
|
|
Loading…
Add table
Reference in a new issue