Update app.py
Browse files
app.py
CHANGED
|
@@ -36,7 +36,9 @@ _search_rate_limiter = RateLimiter(requests_per_minute=20)
|
|
| 36 |
_fetch_rate_limiter = RateLimiter(requests_per_minute=25)
|
| 37 |
|
| 38 |
|
| 39 |
-
def _truncate_for_log(value:
|
|
|
|
|
|
|
| 40 |
if len(value) <= limit:
|
| 41 |
return value
|
| 42 |
return value[: limit - 1] + "…"
|
|
|
|
| 36 |
_fetch_rate_limiter = RateLimiter(requests_per_minute=25)
|
| 37 |
|
| 38 |
|
| 39 |
+
def _truncate_for_log(value: Any, limit: int = 500) -> str:
|
| 40 |
+
if not isinstance(value, str):
|
| 41 |
+
value = str(value)
|
| 42 |
if len(value) <= limit:
|
| 43 |
return value
|
| 44 |
return value[: limit - 1] + "…"
|