MCPcopy Index your code
hub / github.com/AstrBotDevs/AstrBot / update_platform_session

Method update_platform_session

astrbot/core/db/sqlite.py:1782–1799  ·  view source on GitHub ↗

Update a Platform session's updated_at timestamp and optionally display_name.

(
        self,
        session_id: str,
        display_name: str | None = None,
    )

Source from the content-addressed store, hash-verified

1780 return sessions_with_projects, total
1781
1782 async def update_platform_session(
1783 self,
1784 session_id: str,
1785 display_name: str | None = None,
1786 ) -> None:
1787 """Update a Platform session's updated_at timestamp and optionally display_name."""
1788 async with self.get_db() as session:
1789 session: AsyncSession
1790 async with session.begin():
1791 values: dict[str, T.Any] = {"updated_at": datetime.now(timezone.utc)}
1792 if display_name is not None:
1793 values["display_name"] = display_name
1794
1795 await session.execute(
1796 update(PlatformSession)
1797 .where(col(PlatformSession.session_id) == session_id)
1798 .values(**values),
1799 )
1800
1801 async def delete_platform_session(self, session_id: str) -> None:
1802 """Delete a Platform session by its ID."""

Callers

nothing calls this directly

Calls 5

nowMethod · 0.80
updateFunction · 0.50
get_dbMethod · 0.45
executeMethod · 0.45
valuesMethod · 0.45

Tested by

no test coverage detected