def _store_job_result_in_cache(*, result, cache): import loggery serialized_result = _internal_serialize_result(result) if type(cache) == str: cache = dict(preset=cache) with loggery.config(**cache): loggery.insert_one(message=serialized_result)
def _load_job_result_from_cache(*, hash_object, cache): import kachery as ka import loggery if type(cache) == str: cache = dict(preset=cache) with loggery.config(**cache): name0 = 'hither_result' hash0 = ka.get_object_hash(hash_object) doc = loggery.find_one({'message.name': name0, 'message.hash': hash0}) if doc is None: return None return doc['message']
def _store_result(*, serialized_result, cache): import loggery if type(cache) == str: cache = dict(preset=cache) with loggery.config(**cache): loggery.insert_one(message=serialized_result)