具有延迟的GAE后端实例 [英] GAE backend instance with deferred

查看:75
本文介绍了具有延迟的GAE后端实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我通过 deferred.defer 使用 urlfetch 。我收到一个超时错误。我读过使用后端实例,如果你的任务需要更多的时间和咕噜声。在有关推送任务的文档中,它会告诉您如何执行此操作:

I am using urlfetch via deferred.defer. I get a timeout error. I've read to use the backend instances if your tasks need more time and grunt. In the documentation on push tasks it shows you how to do this:

taskqueue.add(url='/path/to/my/worker/', params={'key': key}, target='1.backend1')

但我找不到如何 target 后端实例,包含 deferred.defer

But I can find no examples of how to target a backend instance with deferred.defer.

推荐答案

您可以使用_target参数执行此操作,例如:

You can do this, use the _target parameter, e.g.:

deferred.defer(func, key=key, _target='1.backend1')

这篇关于具有延迟的GAE后端实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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