Skip to content

Commit

Permalink
fix: use token when retrieving the otterdog config to avoid rate limi…
Browse files Browse the repository at this point in the history
…t errors
  • Loading branch information
netomi committed Feb 8, 2024
1 parent d8560de commit 8362614
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions otterdog/webapp/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class AppConfig(object):
OTTERDOG_CONFIG_OWNER = config("OTTERDOG_CONFIG_OWNER", default=None)
OTTERDOG_CONFIG_REPO = config("OTTERDOG_CONFIG_REPO", default=None)
OTTERDOG_CONFIG_PATH = config("OTTERDOG_CONFIG_PATH", default=None)
OTTERDOG_CONFIG_TOKEN = config("OTTERDOG_CONFIG_TOKEN", default=None)

# Set up the App SECRET_KEY
SECRET_KEY = config("SECRET_KEY", default=None)
Expand Down
2 changes: 1 addition & 1 deletion otterdog/webapp/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def _load_otterdog_config(ref: Optional[str] = None) -> OtterdogConfig:
f"'https://github.com/{config_file_owner}/{config_file_repo}/{config_file_path}'"
)

rest_api = RestApi() # do not use authentication for retrieving the config file
rest_api = RestApi(token_auth(current_app.config["OTTERDOG_CONFIG_TOKEN"]))
content = await rest_api.content.get_content(config_file_owner, config_file_repo, config_file_path, ref)
import aiofiles

Expand Down

0 comments on commit 8362614

Please sign in to comment.