Skip to content

Commit

Permalink
fix: crash
Browse files Browse the repository at this point in the history
  • Loading branch information
MistEO committed Jan 17, 2025
1 parent 53b04e4 commit b1c2ac4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/database/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from loguru import logger
from peewee import (
MySQLDatabase,
ReconnectMySQLDatabase,
CompositeKey,
Model,
CharField,
Expand All @@ -12,7 +12,7 @@

from src.config import settings

db = MySQLDatabase(
db = ReconnectMySQLDatabase(
database=settings.database,
host=settings.database_host,
port=settings.database_port,
Expand Down
5 changes: 3 additions & 2 deletions src/order/afdian/factory.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from dataclasses import dataclass
from typing import Tuple
from typing import Tuple, Any
from loguru import logger
from datetime import datetime, timedelta
import json
Expand All @@ -9,7 +9,7 @@
from .query_afdian import query_order_by_out_trade_no


async def process_order(out_trade_no: str) -> Tuple[bool, str]:
async def process_order(out_trade_no: str) -> Tuple[Any, str]:
response = await query_order_by_out_trade_no(out_trade_no)
if not response or response.get("ec") != 200:
logger.error(
Expand Down Expand Up @@ -42,6 +42,7 @@ async def process_order(out_trade_no: str) -> Tuple[bool, str]:
)
except Exception as e:
logger.error(f"Create bill failed, out_trade_no: {out_trade_no}, error: {e}")
return None, "Create bill failed"

if not bill:
logger.error(f"Create bill failed, out_trade_no: {out_trade_no}")
Expand Down

0 comments on commit b1c2ac4

Please sign in to comment.