手动日志服务刷新是否启用自动刷新? [英] Should manual logservice flush work with automatic flush enabled?
问题描述
我有一个cron作业发送电子邮件。为了在GAE配额内,每个电子邮件发送后,它睡了8秒钟( time.sleep(8)
)。结果,作业运行超过60秒,我得到 CancelledError:API调用logservice.Flush()显式取消了
异常。
I have a cron job sending email messages. In order to be within GAE quotas, after each email sent it sleeps for 8 seconds (time.sleep(8)
). In result, the job runs more than 60 seconds and I get CancelledError: The API call logservice.Flush() was explicitly cancelled
exception.
我找到了解决方案这里,并在每次发送消息后手动调用 logservice.Flush()
,但没有帮助。所以,我试图理解的原因。如果我将 AUTOFLUSH_ENABLED
更改为 False
,请使用手动冲洗?
I've found the solution here and started to call logservice.Flush()
manually after each message sent, but it didn't help. So, I am trying to understand the reason. Should I change AUTOFLUSH_ENABLED
to False
to use manual flush?
推荐答案
时间,可以使用任务队列替换达到配额,以及管理队列速率,如文档。
Most of the time, sleeping to reach quotas can be replaced with using task queues, and managing the queue rate, as explained in the documentation.
这篇关于手动日志服务刷新是否启用自动刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!