Some checks failed
CD Pipeline / deploy (push) Failing after 59s
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml) - 部署模式: rsync Python 檔案至 188 → docker restart (volume mount) - Dockerfile/requirements 變動時自動重建 Docker image - 部署通知: Telegram (開始/成功/失敗) - 健康檢查: https://mo.wooo.work/health (最多 5 次重試) - 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
import os
|
|
import sys
|
|
from sqlalchemy import create_engine
|
|
from sqlalchemy.orm import sessionmaker
|
|
|
|
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
|
sys.path.insert(0, BASE_DIR)
|
|
from database.models import Product
|
|
|
|
DB_PATH = os.path.join(BASE_DIR, 'data', 'momo_database.db')
|
|
engine = create_engine(f'sqlite:///{DB_PATH}')
|
|
Session = sessionmaker(bind=engine)
|
|
session = Session()
|
|
|
|
i_codes = ['6323590', '7904362', '5954422', '6009343', '4248163', '3331634', '7351198',
|
|
'12589232', '11118441', '10755887', '9009264', '9562474', '11038732', '10901361',
|
|
'9250857', '5477268', '9600967', '10440331', '10080994', '9900915', '3821684',
|
|
'10567236', '13351736', '13351734', '12777975', '11640264', '5894654', '10050962',
|
|
'8318051', '11593427', '9857434']
|
|
|
|
correct = 0
|
|
incorrect = 0
|
|
|
|
for i_code in i_codes:
|
|
product = session.query(Product).filter(Product.i_code == i_code).first()
|
|
if product and product.image_url and i_code in product.image_url:
|
|
correct += 1
|
|
else:
|
|
incorrect += 1
|
|
if product:
|
|
print(f"❌ [{i_code}] {product.image_url}")
|
|
|
|
print(f"\n📊 驗證結果: ✅ {correct}/{len(i_codes)} 正確")
|
|
if incorrect > 0:
|
|
print(f"❌ {incorrect} 個錯誤")
|
|
|
|
session.close()
|