Open danielbenami opened 3 years ago
Hello,
How many instances of class X do you have for this request ? If you have 3 objects of class X, because of the dependency on "self.exp_id" in the method, it would explain that the method is called once for each object.
Best regards, Laurent Lyaudet
Instance method is being called multiple time. E.g.
This method is called from other instance methods of the same class. Though this latter method cannot be cached (it's returns a pandas dataframe) e.g.
Finally it is also called from other instance method, where an instance of Class X() is being injected as a dependency using 'django-injector', e.g.:
Expected result: cached method is only run once per http request observed result: it runs 3 times. If I remove the cache decorator it runs 6 times, so it partially works.