Skip to content

Commit 35add4d

Browse files
committed
Fix: use-list-literal list() --> []
1 parent 140a60d commit 35add4d

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

aikido_zen/background_process/commands/sync_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@ def process_sync_data(connection_manager, data, conn, queue=None):
3333
connection_manager.middleware_installed = True
3434

3535
# Sync hostnames
36-
for hostnames_entry in data.get("hostnames", list()):
36+
for hostnames_entry in data.get("hostnames", []):
3737
connection_manager.hostnames.add(
3838
hostnames_entry["hostname"],
3939
hostnames_entry["port"],
4040
hostnames_entry["hits"],
4141
)
4242

4343
# Sync users
44-
for user_entry in data.get("users", list()):
44+
for user_entry in data.get("users", []):
4545
connection_manager.users.add_user_from_entry(user_entry)
4646

4747
# Sync stats

aikido_zen/ratelimiting/rate_limiter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def is_allowed(self, key, window_size_in_ms, max_requests):
2121
Checks if the request is allowed given the history
2222
"""
2323
current_time = get_unixtime_ms()
24-
request_timestamps = self.rate_limited_items.get(key) or list()
24+
request_timestamps = self.rate_limited_items.get(key) or []
2525

2626
# clear entries that are not in the rate-limiting window anymore
2727
request_timestamps = [

0 commit comments

Comments
 (0)