newargs = [
arg.strip('\n') for arg in contents.split('\n') if 'config_savefile' not in arg
]
+ size = sys.getsizeof(newargs)
+ if size > 1024 * 1024:
+ raise Exception(f'Saved args are too large! ({size} bytes)')
except Exception as e:
raise Exception(f'Error reading {zkpath} from zookeeper.') from e
SAVED_MESSAGES.append(f'Loaded config from zookeeper from {zkpath}')