Django python-rq - DatabaseError SSL错误:解密失败或坏记录mac [英] Django python-rq -- DatabaseError SSL error: decryption failed or bad record mac

查看:153
本文介绍了Django python-rq - DatabaseError SSL错误:解密失败或坏记录mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用django-redis和django_rq框架来支持我在Heroku上的Django应用程序的redis缓存和redis后台任务处理。它过去工作顺利,但是现在我每次我的一个工作都运行时,我会继续收到一个 DatabaseError SSL错误:解密失败或错误的记录mac

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.

我发现在 https:// devcenter中的Postgres会出现此错误.heroku.com / articles / postgres-logs-errors 文章,但它并没有真正给我任何有用的python设置。

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.

推荐答案

通过在每个作业开始时关闭数据库连接来解决问题。

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

例如,

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

这篇关于Django python-rq - DatabaseError SSL错误:解密失败或坏记录mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆