MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / update

Method update

methods/MIRIX/mirix/orm/sqlalchemy_base.py:454–469  ·  view source on GitHub ↗
(self, db_session: AsyncSession, actor: Optional["Client"] = None)

Source from the content-addressed store, hash-verified

452 @handle_db_timeout
453 @transaction_retry(max_retries=5, base_delay=0.1, max_delay=3.0)
454 async def update(self, db_session: AsyncSession, actor: Optional["Client"] = None) -> "SqlalchemyBase":
455 logger.debug("Updating %s with ID: %s with actor=%s", self.__class__.__name__, self.id, actor)
456 if actor:
457 self._set_created_and_updated_by_fields(actor.id)
458
459 self.set_updated_at()
460
461 try:
462 db_session.add(self)
463 await db_session.commit()
464 await db_session.refresh(self)
465 return self
466 except Exception as e:
467 await db_session.rollback()
468 logger.error("Failed to update %s with ID %s: %s", self.__class__.__name__, self.id, e)
469 raise
470
471 @classmethod
472 @handle_db_timeout

Callers 15

deleteMethod · 0.95
delete_with_redisMethod · 0.95
traced_callFunction · 0.45
_do_embeddingMethod · 0.45
createFunction · 0.45
put_messagesFunction · 0.45
execute_toolMethod · 0.45

Calls 7

commitMethod · 0.80
rollbackMethod · 0.80
debugMethod · 0.65
errorMethod · 0.65
set_updated_atMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected