Django python-rq — DatabaseError SSL error: decryption failed or bad record mac

半城伤御伤魂 提交于 2019-12-04 18:56:36

问题


I'm using the django-redis and django_rq frameworks to support both redis caching and redis background task processing for my Django application on Heroku. It's worked smoothly in the past, however now I keep getting a DatabaseError SSL error: decryption failed or bad record mac every time one of my jobs get run.

I read that this error occurs commonly with Postgres in the https://devcenter.heroku.com/articles/postgres-logs-errors article, but it hasn't really been giving me anything useful for my python setup.


回答1:


The problem is solved by closing the DB connection at the beginning of each job.

For example,

@job
some_job():
    from django.db import connection
    connection.close()
    some_more_code()


来源:https://stackoverflow.com/questions/17523912/django-python-rq-databaseerror-ssl-error-decryption-failed-or-bad-record-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!