import hashlib,json,os,sys from pathlib import Path sys.path.insert(0,'/www/server/xingyu-im/ops') from baota_publish_test_users import database,env_values,query binary=Path('/www/server/xingyu-im/bt/xingyu-api') conn,_=database(env_values()) try: row=query(conn,"""SELECT COUNT(*),SUM(privacy.distance_visible=1),SUM(location.user_id IS NOT NULL),SUM(location.source='fixture') FROM users user JOIN user_privacy_settings privacy ON privacy.user_id=user.id LEFT JOIN user_location_states location ON location.user_id=user.id WHERE user.is_test=1 AND user.test_batch=%s AND user.deleted_at IS NULL""",('cn-adults-20260831-v1',))[0] result={'backendSha256':hashlib.sha256(binary.read_bytes()).hexdigest(),'appRelease':os.path.realpath('/www/wwwroot/im.bchongw.com/app'),'coverage':[int(x) for x in row]} print(json.dumps(result)) finally: conn.close()