Skip to content

Commit

Permalink
Remove sync_interval argument from middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimon committed Oct 24, 2023
1 parent 46af7e0 commit fbbfc3a
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 12 deletions.
4 changes: 0 additions & 4 deletions apitally/django.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ class ApitallyMiddlewareConfig:
env: str
app_version: Optional[str]
sync_api_keys: bool
sync_interval: float
openapi_url: Optional[str]
identify_consumer_callback: Optional[Callable[[HttpRequest], Optional[str]]]

Expand All @@ -49,7 +48,6 @@ def __init__(self, get_response: Callable[[HttpRequest], HttpResponse]) -> None:
client_id=self.config.client_id,
env=self.config.env,
sync_api_keys=self.config.sync_api_keys,
sync_interval=self.config.sync_interval,
)
self.client.start_sync_loop()
self.client.send_app_info(
Expand All @@ -67,7 +65,6 @@ def configure(
env: str = "default",
app_version: Optional[str] = None,
sync_api_keys: bool = False,
sync_interval: float = 60,
openapi_url: Optional[str] = None,
identify_consumer_callback: Optional[str] = None,
) -> None:
Expand All @@ -76,7 +73,6 @@ def configure(
env=env,
app_version=app_version,
sync_api_keys=sync_api_keys,
sync_interval=sync_interval,
openapi_url=openapi_url,
identify_consumer_callback=import_string(identify_consumer_callback)
if identify_consumer_callback
Expand Down
5 changes: 1 addition & 4 deletions apitally/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ def __init__(
env: str = "default",
app_version: Optional[str] = None,
sync_api_keys: bool = False,
sync_interval: float = 60,
openapi_url: Optional[str] = None,
filter_unhandled_paths: bool = True,
) -> None:
self.app = app
self.wsgi_app = app.wsgi_app
self.filter_unhandled_paths = filter_unhandled_paths
self.client = ApitallyClient(
client_id=client_id, env=env, sync_api_keys=sync_api_keys, sync_interval=sync_interval
)
self.client = ApitallyClient(client_id=client_id, env=env, sync_api_keys=sync_api_keys)
self.client.start_sync_loop()
self.delayed_send_app_info(app_version, openapi_url)

Expand Down
5 changes: 1 addition & 4 deletions apitally/starlette.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,13 @@ def __init__(
env: str = "default",
app_version: Optional[str] = None,
sync_api_keys: bool = False,
sync_interval: float = 60,
openapi_url: Optional[str] = "/openapi.json",
filter_unhandled_paths: bool = True,
identify_consumer_callback: Optional[Callable[[Request], Optional[str]]] = None,
) -> None:
self.filter_unhandled_paths = filter_unhandled_paths
self.identify_consumer_callback = identify_consumer_callback
self.client = ApitallyClient(
client_id=client_id, env=env, sync_api_keys=sync_api_keys, sync_interval=sync_interval
)
self.client = ApitallyClient(client_id=client_id, env=env, sync_api_keys=sync_api_keys)
self.client.start_sync_loop()
self.delayed_send_app_info(app_version, openapi_url)
super().__init__(app)
Expand Down

0 comments on commit fbbfc3a

Please sign in to comment.