Skip to content

Commit

Permalink
🐛 Bug: Fix the bug where API initialization throws an error when no A…
Browse files Browse the repository at this point in the history
…PI key is present.
  • Loading branch information
yym68686 committed Nov 5, 2024
1 parent c8dbefd commit 4e9c49c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async def get_user_rate_limit(app, api_index: str = None):
import asyncio

class ThreadSafeCircularList:
def __init__(self, items, rate_limit={"default": "999999/min"}):
def __init__(self, items = [], rate_limit={"default": "999999/min"}):
self.items = items
self.index = 0
self.lock = asyncio.Lock()
Expand Down Expand Up @@ -247,6 +247,8 @@ def update_config(config_data, use_config_url=False):

provider_api = provider.get('api', None)
if provider_api:
if isinstance(provider_api, int):
provider_api = str(provider_api)
if isinstance(provider_api, str):
provider_api_circular_list[provider['provider']] = ThreadSafeCircularList(
[provider_api],
Expand Down

0 comments on commit 4e9c49c

Please sign in to comment.