【发布时间】:2014-04-05 21:33:59
【问题描述】:
我在我的应用程序中看到了一些常见的情况。当我的流量很少或没有流量时,我的服务器无缘无故变慢。经过大量试验和错误后,我发现当我删除我的TastyPie 资源上的ToOneField 时,我的问题消失了!
我发现出于某种未知原因,TastyPie 无缘无故对这些 ToOneFields 进行 数据库更新!什么...时刻!
我发现了一个可能的错误提交here,它声称已修复更新问题。我已经从pip 安装了最新版本,但仍然看到这个问题。
谁能帮忙?
class IncentiveResource(ModelResource):
product_introducer = fields.ToOneField(ProductResource, 'referrer_product', full=True)
product_friend = fields.ToOneField(ProductResource, 'referee_product', full=True)
class Meta:
queryset = Incentive.objects.all().order_by('-date_created')
resource_name = 'incentive'
allowed_methods = ['get']
authentication = MultiAuthentication(ClientAuthentication(), ApiKeyAuthentication())
authorization = Authorization()
filtering = {
"active": ALL,
}
always_return_data = True
cache = SimpleCache(cache_name='resources', timeout=10)
这里的流量很少,但变得无法使用。
【问题讨论】:
-
上面显示的分析输出...是什么工具做的?
-
@8one6 这是新遗物