-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQL Alchemy / Heroku compatability #26
Conversation
db_url = os.getenv("DATABASE_URL") | ||
if db_url.startswith("postgres://"): | ||
db_url = db_url.replace("postgres://", "postgresql://", 1) | ||
return db_url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
couldn't we just do:
if os.getenv("DATABASE_URL"):
return os.getenv("DATABASE_URL").replace("postgres://", "postgresql://", 1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also why did we drop the +psycopg2
part?
|
||
await discord_client.start(settings.DISCORD_BOT_TOKEN) | ||
|
||
await discord_client.wait_until_ready() | ||
await asyncio.Future() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what purpose does this serve?
from src.infrastructure.config.settings import load_environment, Settings | ||
from src.infrastructure.notion_client.client import NotionClient | ||
from src.infrastructure.discord_client.client import DiscordClient | ||
from src.domain.notion.repositories import SQLNotionRepository | ||
from src.application.notion.notion_service import NotionService | ||
from src.application.discord.discord_service import DiscordService | ||
from src.scripts.init_db import init_db |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would prefer to see this "init_db" functionality added as like a utility or something and then imported into the "scripts/init_db.py" file instead of the other way around
user_model = NotionUserModel( | ||
id=user.id, name=user.name or "Unknown User", avatar_url=user.avatar_url | ||
) | ||
session.add(user_model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to commit after this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a few comments
Closing PR. I was encountering an error locally to try and replicate and issue that Bagel was having with deploying the changes to Heroku (staging). This has since been resolved and as such these changes are unnecessary. |
Changes
Fixes error when checking for new creations / update