Skip to content

Commit

Permalink
2024年8月29日 优化禁用用户
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed Aug 29, 2024
1 parent d7fdba2 commit 6fdb54b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
16 changes: 9 additions & 7 deletions get_user.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,19 @@
date : 2017年11月15日
role : 权限同步和鉴定
"""
import json
import time
import hashlib
import datetime
import hashlib
import json
import logging
import time

import requests
from models.authority import Users
from settings import settings
from sqlalchemy import and_, or_
from websdk2.db_context import DBContextV2 as DBContext
from websdk2.model_utils import insert_or_update

from models.authority import Users
from settings import settings

try:
requests.packages.urllib3.disable_warnings()
except:
Expand Down Expand Up @@ -78,7 +79,8 @@ def index():
except Exception as err:
logging.info(f'async_all_user_redis_lock_key Exception {err}')

session.query(Users).filter(Users.source == "ucenter", Users.source_account_id.notin_(user_id_list)).update(
session.query(Users).filter(Users.source == "ucenter", Users.status != "20",
Users.source_account_id.notin_(user_id_list)).update(
{"status": "20"}, synchronize_session=False)
logging.info(f'async_all_user_redis_lock_key end ')

Expand Down
3 changes: 2 additions & 1 deletion libs/sync_user_verift_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ def index():
except Exception as err:
logging.error(f'同步用户中心数据 出错 {err}')

session.query(Users).filter(Users.source == "ucenter", Users.source_account_id.notin_(user_id_list)).update(
session.query(Users).filter(Users.source == "ucenter", Users.status != "20",
Users.source_account_id.notin_(user_id_list)).update(
{"status": "20"}, synchronize_session=False)
logging.info('开始同步用户中心数据 结束')

Expand Down

0 comments on commit 6fdb54b

Please sign in to comment.