I hereby claim:
- I am dhruvg on github.
- I am dhruvg (https://keybase.io/dhruvg) on keybase.
- I have a public key whose fingerprint is E9D6 8B95 15B9 59C5 E2BE C729 A522 3BCE 0FA2 B432
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
from sqlalchemy import event, orm | |
from sqlalchemy.inspection import inspect | |
from sqlalchemy.orm import object_mapper | |
from sqlalchemy.orm.properties import ColumnProperty | |
from test_project.storage import Session | |
class SessionTracker(object): | |
def __init__(self, sessionmaker): |
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# Adapted from: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |