From 9ed13a402332f6b6c4be2b7b14606b87caa607b4 Mon Sep 17 00:00:00 2001 From: RK Date: Tue, 30 Mar 2021 20:58:39 +0100 Subject: [PATCH] Fix provider documentation (#440) Make example more realistic. This would break if you're running flask with multiple threads. --- examples/providers/singleton_scoped.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/providers/singleton_scoped.py b/examples/providers/singleton_scoped.py index 0d40a6e7..a07c74e5 100644 --- a/examples/providers/singleton_scoped.py +++ b/examples/providers/singleton_scoped.py @@ -10,7 +10,7 @@ class Service: class Container(containers.DeclarativeContainer): - service_provider = providers.Singleton(Service) + service_provider = providers.ThreadLocalSingleton(Service) def index_view():