Skip to content

Commit

Permalink
rename MEILI_HOST to MEILI_URL
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Feb 18, 2024
1 parent 2732d7d commit 49c5e19
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ pip install -r requirements.txt
## Setup environment variables

```bash
MEILI_URL # MeiliSearch host.
# default: "http://localhost:7700"
MEILI_KEY # MeiliSearch API key.
# default: '' (empty string)
MEILI_HOST # MeiliSearch host.
# default: "http://localhost:7700"

STWP_SEARCH_MAX_LOAD # If the load is higher than this, API will return 503.
# default: cpu_count / 1.5
STWP_SEARCH_MAX_FLYING_OPS # If the number of flying requests is higher than this, API will return 503.
Expand Down
6 changes: 3 additions & 3 deletions saveweb-search-backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

MEILI_KEY = os.getenv('MEILI_KEY', '')
print('$MEILI_KEY', 'set' if MEILI_KEY else 'not set')
MEILI_HOST = os.getenv('MEILI_HOST', 'http://127.0.0.1:7700')
print('$MEILI_HOST', MEILI_HOST)
MEILI_URL = os.getenv('MEILI_URL', 'http://127.0.0.1:7700')
print('$MEILI_URL', MEILI_URL)
STWP_SEARCH_MAX_LOAD = float(os.getenv('STWP_SEARCH_MAX_LOAD')) if os.getenv('STWP_SEARCH_MAX_LOAD') else (
os.cpu_count() / 1.5 if os.cpu_count() else 1.5
)
Expand Down Expand Up @@ -94,7 +94,7 @@ async def wrapper(*args, **kwargs):
return wrapper


client = meilisearch_python_sdk.AsyncClient(MEILI_HOST, MEILI_KEY)
client = meilisearch_python_sdk.AsyncClient(MEILI_URL, MEILI_KEY)


@app.get('/api/')
Expand Down

0 comments on commit 49c5e19

Please sign in to comment.