Skip to content

Commit 0a5ab9e

Browse files
committed
Fixed module setup
1 parent 0c93454 commit 0a5ab9e

File tree

4 files changed

+7
-9
lines changed

4 files changed

+7
-9
lines changed

ellar_throttler/module.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from ellar.common import Module
44
from ellar.core import IExecutionContext
5-
from ellar.core.modules import DynamicModule, IModuleConfigure, ModuleBase
5+
from ellar.core.modules import DynamicModule, IModuleSetup, ModuleBase
66
from ellar.di import ProviderConfig
77

88
from ellar_throttler.interfaces import IThrottlerStorage
@@ -11,9 +11,9 @@
1111

1212

1313
@Module()
14-
class ThrottlerModule(ModuleBase, IModuleConfigure):
14+
class ThrottlerModule(ModuleBase, IModuleSetup):
1515
@classmethod
16-
def module_configure(
16+
def setup(
1717
cls,
1818
ttl: int,
1919
limit: int,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ classifiers = [
4141
]
4242

4343
dependencies = [
44-
"ellar >= 0.2.2"
44+
"ellar >= 0.3.4"
4545
]
4646

4747

tests/app/controller/module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
@Module(
12-
modules=[ThrottlerModule.module_configure(limit=5, ttl=60)],
12+
modules=[ThrottlerModule.setup(limit=5, ttl=60)],
1313
controllers=(DefaultController, LimitController, AppController),
1414
providers=[AppService],
1515
)

tests/test_throttler.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def test_skip_configure(self):
108108
class TestThrottlerStorageServiceConfiguration:
109109
test_module_cache = TestClientFactory.create_test_module(
110110
modules=(
111-
ThrottlerModule.module_configure(
111+
ThrottlerModule.setup(
112112
limit=5, ttl=100, storage=CacheThrottlerStorageService
113113
),
114114
ControllerModule,
@@ -118,9 +118,7 @@ class TestThrottlerStorageServiceConfiguration:
118118

119119
test_module_use_value = TestClientFactory.create_test_module(
120120
modules=(
121-
ThrottlerModule.module_configure(
122-
limit=5, ttl=100, storage=ThrottlerStorageService()
123-
),
121+
ThrottlerModule.setup(limit=5, ttl=100, storage=ThrottlerStorageService()),
124122
ControllerModule,
125123
),
126124
global_guards=[ThrottlerGuard],

0 commit comments

Comments
 (0)