Control Booking Options, add search fallback and API credit stats - #14
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🌍 Web previewPreview is pinned to commit |
Mục tiêu
Tách rõ quota theo từng SerpApi credential, không tự chạy Booking Options mỗi lần refresh, nhưng vẫn tận dụng credential Booking Options làm nguồn search dự phòng khi các credential tracking hết quota hoặc lỗi.
Thay đổi
BOOKING_OPTIONS_ENABLED:SERPAPI_BOOKING_API_KEY.BOOKING_OPTIONS_LIMIT_PER_ROUTEđể giới hạn số offer enrich.SERPAPI_API_KEYSERPAPI_API_KEY_2SERPAPI_API_KEY_3SERPAPI_BOOKING_API_KEYlàm last-resort Google Flights search credential.scripts/update-api-usage.mjsgọi SerpApi Account API để lấy usage thật của từng credential/account: đã dùng, tổng tháng, còn lại, plan.data/api-usage.jsonvà tự cập nhật bảng usage trongREADME.mdsau mỗi refresh.Credit / request flow
4 offer × 2 route).Dữ liệu mới
data/api-usage.jsonSerpApi usage / creditstrong README được workflow cập nhật tự động.Lưu ý
Usage lấy từ Account API là usage theo account đứng sau từng credential. Nếu credential còn dùng ở project khác, README sẽ phản ánh cả phần usage đó.