From: Baris Metin Date: Mon, 11 Apr 2011 20:37:09 +0000 (-0400) Subject: use PLC_RATELIMIT_ENABLED to enable ratelimit aspect X-Git-Tag: plcapi-5.0-33~12 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=40785ed42aacff32beac8f18cb65e5534eb9d064;p=plcapi.git use PLC_RATELIMIT_ENABLED to enable ratelimit aspect --- diff --git a/PLC/API.py b/PLC/API.py index 191720dd..308fa11a 100644 --- a/PLC/API.py +++ b/PLC/API.py @@ -147,6 +147,10 @@ class PLCAPI: if self.config.PLC_OMF_ENABLED: from aspects import apply_omf_aspect apply_omf_aspect() + + if self.config.PLC_RATELIMIT_ENABLED: + from aspects import apply_ratelimit_aspect + apply_ratelimit_aspect() def callable(self, method): diff --git a/aspects/__init__.py b/aspects/__init__.py index cdab6d60..aa7b05c5 100644 --- a/aspects/__init__.py +++ b/aspects/__init__.py @@ -7,6 +7,8 @@ from aspects.ratelimitaspects import RateLimitAspect def apply_omf_aspect(): # track all PLC methods to add OMF hooks weave_class_method(OMFAspect(), Method, "__call__") + +def apply_ratelimit_aspect(): weave_class_method(RateLimitAspect(), Method, "__call__") def apply_debugger_aspect():