style(msteams): hoist time import

This commit is contained in:
T3chC0wb0y 2026-04-15 19:02:04 -05:00 committed by chengyongru
parent 7545b58a00
commit 2f3a37cf8e

View File

@ -17,6 +17,7 @@ import importlib.util
import json import json
import re import re
import threading import threading
import time
from dataclasses import dataclass from dataclasses import dataclass
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from typing import TYPE_CHECKING, Any from typing import TYPE_CHECKING, Any
@ -423,7 +424,6 @@ class MSTeamsChannel(BaseChannel):
async def _get_botframework_openid_config(self) -> dict[str, Any]: async def _get_botframework_openid_config(self) -> dict[str, Any]:
"""Fetch and cache Bot Framework OpenID configuration.""" """Fetch and cache Bot Framework OpenID configuration."""
import time
now = time.time() now = time.time()
if self._botframework_openid_config and now < self._botframework_openid_config_expires_at: if self._botframework_openid_config and now < self._botframework_openid_config_expires_at:
@ -440,7 +440,6 @@ class MSTeamsChannel(BaseChannel):
async def _get_botframework_jwks(self) -> dict[str, Any]: async def _get_botframework_jwks(self) -> dict[str, Any]:
"""Fetch and cache Bot Framework JWKS.""" """Fetch and cache Bot Framework JWKS."""
import time
now = time.time() now = time.time()
if self._botframework_jwks and now < self._botframework_jwks_expires_at: if self._botframework_jwks and now < self._botframework_jwks_expires_at:
@ -494,7 +493,6 @@ class MSTeamsChannel(BaseChannel):
async def _get_access_token(self) -> str: async def _get_access_token(self) -> str:
"""Fetch an access token for Bot Framework / Azure Bot auth.""" """Fetch an access token for Bot Framework / Azure Bot auth."""
import time
now = time.time() now = time.time()
if self._token and now < self._token_expires_at - 60: if self._token and now < self._token_expires_at - 60: