我正在写一个烧瓶应用程序,要求用户上传excel电子表格然后计算并填充数据库。我正在尝试通过 Redis RQ 在后台处理部分,但我一直在< em> TypeError:无法序列化'_io.TextIOWrapper'对象 我的代码看起来像这样:
from redis import Redis
from rq import Queue
from rq.job import Job
import xlrd as x
workbook = x.open_workbook('data.xls')
sheet = workbook.sheet_by_index(0)
q = Queue(connection = Redis())
def populate(sheet,row,column):
#extract data and save into database
job = enqueue_call(func=populate, args=(sheet,7,5), result_ttl = 5000)
print(job.get_id())