Actions
Bug #12621
closedExcessive TemplateKind DB queries when retrieving API docs
Description
When viewing uncached API docs (e.g. /apidoc/v2/hosts.html), there are loads of DB queries for TemplateKinds:
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
2015-11-27T09:50:41 [sql] [D] TemplateKind Load (0.1ms) SELECT "template_kinds".* FROM "template_kinds"
This is because of my bad recommendation to query it on the fly in config/initializers/apipie.rb during #11643.
Perhaps to fix it we'll need to remove it again from the lambda but simply fail safely when the table isn't set up?
Actions