MCPcopy
hub / github.com/TaskingAI/TaskingAI / pop

Method pop

backend/tkhelper/models/redis.py:75–87  ·  view source on GitHub ↗
(self, entity: ModelEntity)

Source from the content-addressed store, hash-verified

73 await self.redis_conn.set_object(key, entity_dict, self.expire)
74
75 async def pop(self, entity: ModelEntity):
76 if not self.redis_conn:
77 return
78
79 # Extract primary key fields and their values from entity
80 pk_fields = self.entity_class.primary_key_fields()
81 pk_values = {field: getattr(entity, field) for field in pk_fields}
82
83 # Generate the Redis key using primary key values
84 key = self.__key(**pk_values, postfix=self.redis_key_postfix)
85
86 # Remove the object from Redis using the generated key
87 await self.redis_conn.pop(key)

Callers 15

validate_beforeMethod · 0.45
validate_beforeMethod · 0.45
IconReverseFunction · 0.45
ModalTableFunction · 0.45
getMethod · 0.45
to_response_dictMethod · 0.45
_update_entityMethod · 0.45
update_entityMethod · 0.45
updateMethod · 0.45
_delete_entityMethod · 0.45
delete_entityMethod · 0.45
deleteMethod · 0.45

Calls 2

__keyMethod · 0.95
primary_key_fieldsMethod · 0.45

Tested by 3

test_create_modelMethod · 0.36
test_update_modelMethod · 0.36
test_list_assistantsMethod · 0.36