6

我正在编写一个烧瓶应用程序,要求用户上传 excel 电子表格,然后计算并填充数据库。我正在尝试通过Redis RQ在后台执行处理部分,但我不断收到TypeError: cannot serialize '_io.TextIOWrapper' object my代码如下所示:

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())
4

0 回答 0