Skip to content

Commit 3504754

Browse files
fix: update .env names and fix SKIP_TRAKT_CACHE (#1001)
* fix: update .env names and fix SKIP_TRAKT_CACHE * fix: remove bool() * chore: revert FORCE_ENV to RIVEN_FORCE_ENV
1 parent 6b295f6 commit 3504754

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

.env.example

+4-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
RIVEN_FORCE_ENV=false
1111

1212
# This is used to specify settings filename. By default it's settings.json.
13-
RIVEN_SETTINGS_FILENAME="settings.json"
13+
SETTINGS_FILENAME="settings.json"
14+
15+
# Whether to use trakt cache or not.
16+
SKIP_TRAKT_CACHE=false
1417

1518
# This will reset the database and recreate all tables, and then exit after running!
1619
HARD_RESET=false

src/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import uvicorn
99
from dotenv import load_dotenv
10-
load_dotenv() # import required here to support RIVEN_SETTINGS_FILENAME
10+
load_dotenv() # import required here to support SETTINGS_FILENAME
1111

1212
from fastapi import FastAPI
1313
from fastapi.middleware.cors import CORSMiddleware

src/program/apis/trakt_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def __init__(self, settings: TraktModel):
5151
self.oauth_redirect_uri = self.settings.oauth.oauth_redirect_uri
5252
rate_limit_params = get_rate_limit_params(max_calls=1000, period=300)
5353
trakt_cache = get_cache_params("trakt", 86400)
54-
use_cache = not os.environ.get("SKIP_TRAKT_CACHE", False)
54+
use_cache = os.environ.get("SKIP_TRAKT_CACHE", "false").lower() == "true"
5555
session = create_service_session(rate_limit_params=rate_limit_params, use_cache=use_cache, cache_params=trakt_cache)
5656
self.headers = {
5757
"Content-type": "application/json",

src/program/settings/manager.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SettingsManager:
1313

1414
def __init__(self):
1515
self.observers = []
16-
self.filename = os.environ.get("RIVEN_SETTINGS_FILENAME", "settings.json")
16+
self.filename = os.environ.get("SETTINGS_FILENAME", "settings.json")
1717
self.settings_file = data_dir_path / self.filename
1818

1919
Observable.set_notify_observers(self.notify_observers)

0 commit comments

Comments
 (0)