db/python/tables/project.py
async def ensure_project_id_cache_is_filled(self):
        """(CACHED) Get map of project names to project IDs"""
        if (
            not ProjectPermissionsTable._cached_project_names
            or ProjectPermissionsTable._cache_expiry < datetime.utcnow()
        ):
            project_rows = await self.get_project_rows(check_permissions=False)
            ProjectPermissionsTable._cached_project_by_id = {
                p.id: p for p in project_rows
            }
            ProjectPermissionsTable._cached_project_names = {
                p.name: p.id for p in project_rows
            }
            ProjectPermissionsTable._cache_expiry = datetime.utcnow() + timedelta(
                minutes=1
            )
(CACHED) Get map of project names to project IDs
(CACHED) Get map of project names to project IDs
( CACHED ) Get map of project names to project IDs
async def ensure_project_id_cache_is_filled(self):
        if (
            not ProjectPermissionsTable._cached_project_names
            or ProjectPermissionsTable._cache_expiry < datetime.utcnow()
        ):
            project_rows = await self.get_project_rows(check_permissions=False)
            ProjectPermissionsTable._cached_project_by_id = {
                p.id: p for p in project_rows
            }
            ProjectPermissionsTable._cached_project_names = {
                p.name: p.id for p in project_rows
            }
            ProjectPermissionsTable._cache_expiry = datetime.utcnow() + timedelta(
                minutes=1
            )
async def ensure_project_id_cache_is_filled ( self ) : if ( not ProjectPermissionsTable . _cached_project_names or ProjectPermissionsTable . _cache_expiry < datetime . utcnow ( ) ) : project_rows = await self . get_project_rows ( check_permissions = False ) ProjectPermissionsTable . _cached_project_by_id = { p . id : p for p in project_rows } ProjectPermissionsTable . _cached_project_names = { p . name : p . id for p in project_rows } ProjectPermissionsTable . _cache_expiry = datetime . utcnow ( ) + timedelta ( minutes = 1 )
(CACHED) Get map of project names to project IDs
( CACHED ) Get map of project names to project IDs
"""(CACHED) Get map of project names to project IDs"""
self