Skip to content

Commit

Permalink
♻️ refactor code
Browse files Browse the repository at this point in the history
  • Loading branch information
suyiiyii committed Dec 21, 2024
1 parent 1370684 commit 1ccfbbb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
3 changes: 0 additions & 3 deletions nonebot_bison/admin_page/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
from fastapi.exceptions import HTTPException
from fastapi.param_functions import Depends
from fastapi.routing import APIRouter
from fastapi.param_functions import Depends
from fastapi.exceptions import HTTPException
from fastapi.security.oauth2 import OAuth2PasswordBearer
import nonebot
from nonebot_plugin_saa import TargetQQGroup
from nonebot_plugin_saa.auto_select_bot import get_bot
from fastapi.security.oauth2 import OAuth2PasswordBearer

from nonebot_bison.apis import check_sub_target
from nonebot_bison.config import NoSuchSubscribeException, NoSuchTargetException, NoSuchUserException, config
Expand Down
2 changes: 1 addition & 1 deletion nonebot_bison/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from nonebot import require

require("nonebot_plugin_prometheus")
from nonebot_plugin_prometheus import Gauge, Counter, Histogram
from nonebot_plugin_prometheus import Counter, Gauge, Histogram

# Request counter
request_counter = Counter(
Expand Down
12 changes: 2 additions & 10 deletions nonebot_bison/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,13 @@
from collections.abc import Callable
from dataclasses import dataclass

from apscheduler.events import EVENT_JOB_MAX_INSTANCES
from nonebot.log import logger
from nonebot_plugin_apscheduler import scheduler
from apscheduler.events import EVENT_JOB_MAX_INSTANCES
from nonebot_plugin_saa.utils.exceptions import NoBotFound

from nonebot_bison.utils import ClientManager
from nonebot_bison.metrics import sent_counter, request_counter, render_histogram, request_histogram

from ..config import config
from ..send import send_msgs
from ..types import Target, SubUnit
from ..platform import platform_manager
from ..utils import Site, ProcessContext
from ..utils.site import SkipRequestException
from nonebot_bison.config import config
from nonebot_bison.metrics import render_histogram, request_counter, request_histogram, sent_counter
from nonebot_bison.platform import platform_manager
from nonebot_bison.send import send_msgs
from nonebot_bison.types import SubUnit, Target
Expand Down
3 changes: 1 addition & 2 deletions nonebot_bison/utils/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@

from nonebot_bison.config import config
from nonebot_bison.config.db_model import Cookie
from nonebot_bison.metrics import cookie_choose_counter
from nonebot_bison.types import Target

from .http import http_client
from ..config.db_model import Cookie
from ..metrics import cookie_choose_counter


class ClientManager(ABC):
Expand Down

0 comments on commit 1ccfbbb

Please sign in to comment.