os环境 centos

python2.7.5

django1.10.8

class AdminAutoRunTask(View):
"""
自动跑外放任务
"""
def post(self, request):
# 省略一些代码
for keyword, number in json.loads(task.keyword).items():
p = multiprocessing.Process(target=self.auto_run_task,
args=(int(number), task.app_id.app_id, keyword))
p.start()
log.info('auto_run_task: task_id=%s,keyword=%s, pid=%s' % (task.id, keyword, p.pid)) return JsonResponse({'code': 1, 'msg': 'success'})

views.py中post处理函数在return之前启动了一个或多个进程,然后虽然这里虽然return了,但是其实前端页面ajax并没有接收到数据。开发环境是好的os ubuntu

表现为ajax超时后抛出异常:net::ERR_INCOMPLETE_CHUNKED_ENCODING

解决方法把进程修改为线程

class AdminAutoRunTask(View):
"""
自动跑外放任务
"""
def post(self, request):
# 省略一些代码 for keyword, number in json.loads(task.keyword).items():
p = threading.Thread(target=self.auto_run_task,
args=(int(number), task.app_id.app_id, keyword))
p.start()
log.info('auto_run_task: task_id=%s,keyword=%s' % (task.id, keyword)) return JsonResponse({'code': 1, 'msg': 'success'})

centos django Failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING的更多相关文章

  1. 报错解决——Failed to load resource: the server responded with a status of 404 (Not Found) favicon.ico文件找不到

    Django项目开发完成后在本地运行没问题,但在推到服务器上后出现报错Failed to load resource: the server responded with a status of 40 ...

  2. Failed to load resource: net::ERR_CACHE_MISS

    Failed to load resource: net::ERR_CACHE_MISS 译为开发人员工具载入缓存的时候,说找不到资源. 原因是你先打开页面,然后打开chrome的开发人员工具.而页面 ...

  3. Chrome系列 Failed to load resource: net::ERR_CACHE_MISS

    在IE/FF下没有该错误提示,但在Chrome下命令行出现如下错误信息: Failed to load resource: net::ERR_CACHE_MISS 该问题是Chrome浏览器开发工具的 ...

  4. Failed to load resource: the server responded with a status of 413 (Request Entity Too Large)

    Node应用,使用formidable处理文件上传,本地测试没有问题,部署到服务器上之后上传大文件浏览器收到以下错误信息: Failed to load resource: the server re ...

  5. .net 上传文件 Failed to load resource: net::ERR_CONNECTION_RESET Bug 解决

    环境: .net 4.0 ashx一般处理程序 使用 html5 FormData ajax上传文件 功能如下:如果用户有登录,则对文件进行处理:如果用户没登录,则直接返回json,提示用户未登录 遇 ...

  6. 使用laravel-admin后台sdk报错Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID、Provisional headers are shown

    报错Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID请先确定自己的资源url是否可以确实访问到(地址正确与否.访问权限是否开启等) 若n ...

  7. ionic报错: Failed to load resource

    隔了一天,才发现是代码写错了 出错的原因是在ts 文件中使用这样的定义 data: [] = ['高新区', '经开区', '其他园区']; 错误在于这个定义的类型,不能是 [],修改成 any就没有 ...

  8. Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET)

    转自: https://blog.csdn.net/kinginblue/article/details/50753271?locationNum=14&fps=1 Nginx反向代理上传大文 ...

  9. jsp中引入jquery报错:Failed to load resource: the server responded with a status of 404 (Not Found)

    问题描述: 今天自己在搭建spring.springMVC.hibernate框架,搭建完成后,在引入jquery时,发现jquery不管用.我的解决顺序是: 1.检查路径,发现路径没错,另外需要注意 ...

随机推荐

  1. Django学习之二:Django 项目创建 和 应用创建

    Django 项目创建 和 应用创建 创建一个Django项目 都是在相应平台的命令行环境下操作: 1. 进入用于存放项目的目录下 1.1 windows下切换目录:先进入具体的分区磁盘中如E盘就输入 ...

  2. Array的 filter() 和 sort()

    filter() filter() 方法创建一个创建一个新数组,新数组中的元素是通过筛选原数组中的元素所得到的.筛选的方式是把传入的函数依次作用于每个元素,然后根据返回值是true还是false决定保 ...

  3. PM过程管理成熟度1级

    之前,我已经从项目实现的角度.企业管理诉求两方面,分析了PM的核心能力架构,以及其在过程管理方面的能力等级.接下来,Fancier凡奉信息会站在PM能力成长的角度,横向与纵向阐述每一成熟度等级PM的过 ...

  4. 关于swagger——WebApi一个controller中出现多个Get是出现错误的处理

    如 /// <summary> /// 测试处理 /// </summary> public class TestController : ApiController { // ...

  5. man -f/-k [keyword]在fedora 29 中报错nothing appropriate

    我们在使用 man 手册的时候,可以使用man -f [keyword]去查询keyword的在线文档,但是这时候会报错:(图来源自网络) 这是因为我们还没有建立 man 手册的索引缓存: 我们可以使 ...

  6. SQLServer之创建全文索引

    创建全文索引的必须条件 必须具有全文目录,然后才能创建全文索引. 目录是包含一个或多个全文索引的虚拟容器. 使用SSMS数据库管理工具创建全文索引 1.连接数据库,选择数据库,选择数据表->右键 ...

  7. LeetCode算法题-Minimum Index Sum of Two Lists(Java实现)

    这是悦乐书的第272次更新,第286篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第139题(顺位题号是599).假设Andy和Doris想要选择一家餐馆吃晚餐,他们都有 ...

  8. Selenium自动化测试-unittest单元测试框架使用

    一.什么是unittest 这里我们将要用的unittest是python的单元测试框架,它的官网是 https://docs.python.org/2/library/unittest.html,在 ...

  9. 【Python 09】汇率兑换2.0-2(分支语句)

    分支语句:根据判断条件选择程序执行路径 1.使用方法 if <条件1>: <语句块1> elif <条件2>: <语句块2> ... else: < ...

  10. addq

    <template> <el-row id="AddRoom"> <el-col :xs="0" :sm="2" ...