Appengine延迟任务出现问题,执行会引发未知错误 [英] Issue with appengine deferred tasks, execution throws unknown error

查看:119
本文介绍了Appengine延迟任务出现问题,执行会引发未知错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在appengine python中推迟了任务,它使用所有task_info字符串,字符串列表进行了简单的调用。它适用于任何任务。

I have task deferred in appengine python its a simple call with all task_info strings, list of strings. It works well for any no of tasks.

               deferred.defer(fetch_service, 
                              _queue = "queue_name",
                              _countdown = task_counter * 4,
                              **task_info  )

当我访问某些端点或UI时,我观察到了奇怪的行为在不同的URL或不同的模块中,此延迟的调用开始失败。每个不同的调用都会引发相同的问题。

I observed a weird behaviour, when I access some endpoints or UI in different URL or different modules, this deferred calls start to fail. Every differed call throws same issue.

File "/base/data/home/runtimes/python27/python27_lib/versions/1/google/appengine/ext/deferred/deferred.py", line 145, in run
    raise PermanentTaskFailure(e)
PermanentTaskFailure: None.fetch_service forbidden in unpickling

正在寻求任何帮助,或其他遇到相同问题的人。

Looking for any help, or others who faced same issue.

推荐答案

此问题特定于Google提供的 GAE python支架。有一个允许腌制的方法的白名单。

This problem is specific to the GAE python scaffold provided by Google. There's a whitelist of methods that are allowed to be pickled.

如果将 fetch_service 方法添加到<$

If you add your fetch_service method to the _PICKLE_CLASS_WHITELIST in base/api_fixers.py list, it will work.

这篇关于Appengine延迟任务出现问题,执行会引发未知错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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