fix(login): 避免登录预算配置锁阻塞恢复任务
This commit is contained in:
@@ -204,12 +204,7 @@ def classify_login_category(
|
||||
|
||||
|
||||
def _setting(db: Session) -> LoginQuotaSetting:
|
||||
row = (
|
||||
db.query(LoginQuotaSetting)
|
||||
.filter(LoginQuotaSetting.id == 1)
|
||||
.with_for_update()
|
||||
.first()
|
||||
)
|
||||
row = db.query(LoginQuotaSetting).filter(LoginQuotaSetting.id == 1).first()
|
||||
if row is None:
|
||||
row = LoginQuotaSetting(id=1)
|
||||
db.add(row)
|
||||
|
||||
Reference in New Issue
Block a user