[随时咕咕] 新版论坛开发记录

新论坛将整合 Mastodon 的 ActivityPub 功能,可以和其他网站互联。

Repo 地址:
https://github.com/rbqpress/rbq

警告:代码非常烂,非常烂,非常烂!
错误:目前尚无任何功能可用!

https://blog.misaka4e21.science/django-q-bugs/

可能是出于防止连接丢失的原因,Django Q 项目在 cluster.py 文件中大>量应用了 db.close_old_connections(),关闭并重新打开数据库连接。而在 Django 自带的单元测试 django.test.TestCase 中,是采用了数据库事务进行测试数据回滚,以实现测试之间互相隔离的目的;在此时关闭数据库连接,就会
使得事务中断,抛出异常——在 psycopg2 中,会说 InterfaceError("connection already closed"),而在 psycopg2cffi 中,会说 TransactionManagementError("An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block

之前查到几个说法,关于 TestCase 改成 TransactionTestCase 之类的,并没有用。

御坂已经 fork 了 django-q 并提出了 PR…感觉会被骂(×

咕咕咕。

1 个赞

御坂又开始纠结技术栈了。

1 个赞