-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: on Price create, create (or get) Location, and link them #36
Conversation
7d9564f
to
87399e7
Compare
688eec5
to
f5cbcb0
Compare
from app.schemas import LocationCreate, PriceBase | ||
|
||
|
||
def create_price_location(db: Session, price: PriceBase): |
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.
are Session
objects thread-safe? As I assume we're using threads to launch a task in the background.
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.
No idea 😅
I used the background tasks example from the fastAPI tutorials: https://fastapi.tiangolo.com/tutorial/background-tasks/
edit : it seems a possible solution: fastapi/fastapi#4956 (comment)
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.
though they do recommend to create a new db session here: fastapi/fastapi#8502 (comment)
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.
added it to #31
f5cbcb0
to
757f1a4
Compare
What
Price.location
create_price_location