Doveps / mono

Code for Doveps projects
http://doveps.com
MIT License
0 stars 0 forks source link

04-13-2018 : Fixed Query issues and Issues making travis fail #146

Closed JosiahRegencia closed 6 years ago

JosiahRegencia commented 6 years ago

I was reading about psycopg2 patterns because not closing the cursor and the connection in query.py really bothered my. I read that it builds up cache. I read from this article about using decorators but from some forums I also read that decorators inside a class is pointless. This forum led me to the solution, instead. https://github.com/Doveps/mono/blob/02df17a70bfbea7be9b4ea1b994333e6616a9a27/savant/app/query.py#L209-L212

Short and effective. Surely works.

At the same time, had to put these functions back in query.py:

https://github.com/Doveps/mono/blob/02df17a70bfbea7be9b4ea1b994333e6616a9a27/savant/app/query.py#L180-L207

I transferred it to results.py in issue #145 but it doesn't go well withtravis testing. it fails. Putting it back in query.py fixes that issue.

Screenshot of passed build:

screenshot from 2018-04-13 23-10-26

greenmoss commented 6 years ago

Good, I remember using __del__ before too, seems like the right way to do it.

I notice those four functions are mostly identical. Any ideas on de-duplicating?