Skip to content

Commit 9ed13a4

Browse files
sonthonaxrkrmk135
authored andcommitted
Fix provider documentation (#440)
Make example more realistic. This would break if you're running flask with multiple threads.
1 parent 7b70f46 commit 9ed13a4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/providers/singleton_scoped.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Service:
1010

1111
class Container(containers.DeclarativeContainer):
1212

13-
service_provider = providers.Singleton(Service)
13+
service_provider = providers.ThreadLocalSingleton(Service)
1414

1515

1616
def index_view():

0 commit comments

Comments
 (0)