kylej1994 / graffiti

2 stars 0 forks source link

s3 client un-initialized bug #177

Closed ronovan closed 7 years ago

ronovan commented 7 years ago

I was thinking of Post models stored in the db as objects, so the s3 client was initialized in the constructor...but when retrieving from the db I guess it doesn't go through the constructor again, so the s3 client must be re-initialized for retrieving the image from s3

hjylewis commented 7 years ago

yo, why does s3_client need to be a property of the classes? can't it just be a global outside of the class?

ronovan commented 7 years ago

that was part of my refactor but I don't think I ever realized how wrong it is now...anyway, gonna move s3 client to graffiti.py and it'll just be passed in at runtime. Thank you!

hjylewis commented 7 years ago

Might also be why you had so many connections to the db (unless I'm getting confused)

ronovan commented 7 years ago

nah, these connections are only to s3

hjylewis commented 7 years ago

much cleaner 👌