| | |
| | | import socket |
| | | import re |
| | | import json |
| | | import sys |
| | | from pathlib import Path |
| | | |
| | | source = Path('yudao-server/src/main/resources/application-local.yaml').read_text(encoding='utf-8') |
| | |
| | | keys.extend(key for key in batch if key.decode().endswith(suffixes)) |
| | | if cursor == b'0': |
| | | break |
| | | menu_suffixes = tuple(':' + str(int(value)) for value in sys.argv[1:]) |
| | | if menu_suffixes: |
| | | cursor = b'0' |
| | | while True: |
| | | cursor, batch = command('SCAN', cursor, 'MATCH', '*menu_role_ids*', 'COUNT', 100) |
| | | keys.extend(key for key in batch if key.decode().endswith(menu_suffixes)) |
| | | if cursor == b'0': |
| | | break |
| | | print('Target permission cache keys:', [key.decode() for key in keys]) |
| | | if keys: |
| | | print('Deleted permission cache entries:', command('DEL', *keys)) |