Skip to content

Commit

Permalink
Fix 2 simple sonar code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
AliOsm committed Sep 2, 2023
1 parent 43b3040 commit 5595d35
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tafrigh/recognizers/wit_calling_throttle.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def throttle(self, wit_client_access_token_index: int) -> None:

self.call_timestamps[wit_client_access_token_index] = list(
filter(
lambda x: now - x < self.expired_time,
lambda call_timestamp, now=now: now - call_timestamp < self.expired_time,
self.call_timestamps[wit_client_access_token_index],
)
)
Expand Down
2 changes: 1 addition & 1 deletion tafrigh/recognizers/wit_recognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def _process_segment(
else:
retries -= 1
time.sleep(self.processes_per_wit_client_access_token + 1)
except:
except Exception:
retries -= 1
time.sleep(self.processes_per_wit_client_access_token + 1)

Expand Down

0 comments on commit 5595d35

Please sign in to comment.