From 6fdb54b460511832435013edd9071067e5bcaf76 Mon Sep 17 00:00:00 2001 From: shenshuo <191715030@qq.com> Date: Thu, 29 Aug 2024 14:25:03 +0800 Subject: [PATCH] =?UTF-8?q?2024=E5=B9=B48=E6=9C=8829=E6=97=A5=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=A6=81=E7=94=A8=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- get_user.py | 16 +++++++++------- libs/sync_user_verift_v4.py | 3 ++- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/get_user.py b/get_user.py index 18deeaa..2b06382 100644 --- a/get_user.py +++ b/get_user.py @@ -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: @@ -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 ') diff --git a/libs/sync_user_verift_v4.py b/libs/sync_user_verift_v4.py index 67361ac..02cb061 100644 --- a/libs/sync_user_verift_v4.py +++ b/libs/sync_user_verift_v4.py @@ -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('开始同步用户中心数据 结束')