From 19d12a74cd758058e3bfa379d58b3e553d33d4f9 Mon Sep 17 00:00:00 2001 From: drevicko Date: Wed, 1 Feb 2017 17:24:55 +0000 Subject: [PATCH] use plug._plain_dict() before returning from analyse() We're experiencing significant delays when we have large objects as plugin instance variables. This edit seems to fix the problem. It looks like the plugin instance is passed (inside the response object) as-is to flask: perhaps flask is walking through it or duplicating it in memory or some such? Not sure... There may be a better way? --- senpy/extensions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/senpy/extensions.py b/senpy/extensions.py index a9228e5..76d4f6b 100644 --- a/senpy/extensions.py +++ b/senpy/extensions.py @@ -103,7 +103,7 @@ class Senpy(object): nif_params.update(specific_params) try: resp = plug.analyse(**nif_params) - resp.analysis.append(plug) + resp.analysis.append(plug._plain_dict()) logger.debug("Returning analysis result: {}".format(resp)) except Exception as ex: resp = Error(message=str(ex), status=500)