@staticmethod<EOL><INDENT>def archive(base_dir: str) -> int:<DEDENT>
LOGGER.debug('<STR_LIT>', base_dir)<EOL>rv = int(time())<EOL>timestamp_dir = join(base_dir, str(rv))<EOL>makedirs(timestamp_dir, exist_ok=True)<EOL>with SCHEMA_CACHE.lock:<EOL><INDENT>with open(join(timestamp_dir, '<STR_LIT>'), '<STR_LIT:w>') as archive:<EOL><INDENT>print(json.dumps(SCHEMA_CACHE.schemata()), file=archive)<EOL><DEDENT><DEDENT>with CRED_DEF_CACHE.lock:<EOL><INDENT>with open(join(timestamp_dir, '<STR_LIT>'), '<STR_LIT:w>') as archive:<EOL><INDENT>print(json.dumps(CRED_DEF_CACHE), file=archive)<EOL><DEDENT><DEDENT>with REVO_CACHE.lock:<EOL><INDENT>with open(join(timestamp_dir, '<STR_LIT>'), '<STR_LIT:w>') as archive:<EOL><INDENT>revo_cache_dict = {}<EOL>for rr_id in REVO_CACHE:<EOL><INDENT>revo_cache_dict[rr_id] = {<EOL>'<STR_LIT>': REVO_CACHE[rr_id].rev_reg_def,<EOL>'<STR_LIT>': [vars(f) for f in REVO_CACHE[rr_id].rr_delta_frames],<EOL>'<STR_LIT>': [vars(f) for f in REVO_CACHE[rr_id].rr_state_frames]<EOL>}<EOL><DEDENT>print(json.dumps(revo_cache_dict), file=archive)<EOL><DEDENT><DEDENT>LOGGER.debug('<STR_LIT>', rv)<EOL>return rv<EOL>
Archive caches to disk as json.

:param base_dir: archive base directory
:return: timestamp (epoch seconds) used as subdirectory