pycommonlog 0.2.5__tar.gz → 0.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/PKG-INFO +1 -1
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/providers/lark.py +6 -6
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog.egg-info/PKG-INFO +1 -1
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/LICENSE +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/README.md +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/__init__.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/cache.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/log_types.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/logger.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/providers/__init__.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/providers/redis_client.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog/providers/slack.py +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog.egg-info/SOURCES.txt +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog.egg-info/dependency_links.txt +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog.egg-info/requires.txt +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/pycommonlog.egg-info/top_level.txt +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/setup.cfg +0 -0
- {pycommonlog-0.2.5 → pycommonlog-0.2.7}/setup.py +0 -0
|
@@ -8,7 +8,7 @@ import threading
|
|
|
8
8
|
from typing import Dict, Optional, Tuple
|
|
9
9
|
|
|
10
10
|
from pycommonlog.log_types import SendMethod, Provider, debug_log
|
|
11
|
-
from pycommonlog.providers.redis_client import get_redis_client
|
|
11
|
+
from pycommonlog.providers.redis_client import get_redis_client
|
|
12
12
|
from pycommonlog.cache import get_memory_cache
|
|
13
13
|
|
|
14
14
|
class LarkProvider(Provider):
|
|
@@ -31,7 +31,7 @@ class LarkProvider(Provider):
|
|
|
31
31
|
expire_seconds = 60
|
|
32
32
|
client.setex(key, expire_seconds, token)
|
|
33
33
|
debug_log(config, f"Lark token cached in Redis for key: {key}")
|
|
34
|
-
except
|
|
34
|
+
except Exception:
|
|
35
35
|
# Fallback to in-memory cache
|
|
36
36
|
expire_seconds = expire - 600
|
|
37
37
|
if expire_seconds <= 0:
|
|
@@ -47,7 +47,7 @@ class LarkProvider(Provider):
|
|
|
47
47
|
if token:
|
|
48
48
|
debug_log(config, f"Lark token retrieved from Redis for key: {key}")
|
|
49
49
|
return token
|
|
50
|
-
except
|
|
50
|
+
except Exception:
|
|
51
51
|
# Fallback to in-memory cache
|
|
52
52
|
token = get_memory_cache().get(key)
|
|
53
53
|
if token:
|
|
@@ -60,7 +60,7 @@ class LarkProvider(Provider):
|
|
|
60
60
|
client = get_redis_client(config)
|
|
61
61
|
client.set(key, chat_id) # No expiry
|
|
62
62
|
debug_log(config, f"Lark chat ID cached in Redis for key: {key}")
|
|
63
|
-
except
|
|
63
|
+
except Exception:
|
|
64
64
|
# Fallback to in-memory cache (no expiry for chat IDs)
|
|
65
65
|
get_memory_cache().set(key, chat_id, 86400 * 30) # 30 days expiry
|
|
66
66
|
debug_log(config, f"Lark chat ID cached in memory for key: {key}")
|
|
@@ -73,7 +73,7 @@ class LarkProvider(Provider):
|
|
|
73
73
|
if chat_id:
|
|
74
74
|
debug_log(config, f"Lark chat ID retrieved from Redis for key: {key}")
|
|
75
75
|
return chat_id
|
|
76
|
-
except
|
|
76
|
+
except Exception:
|
|
77
77
|
# Fallback to in-memory cache
|
|
78
78
|
chat_id = get_memory_cache().get(key)
|
|
79
79
|
if chat_id:
|
|
@@ -223,7 +223,7 @@ class LarkProvider(Provider):
|
|
|
223
223
|
}
|
|
224
224
|
debug_log(config, f"send_lark_webclient: sending HTTP request, payload size: {len(str(payload))}, payload: {json.dumps(payload)}")
|
|
225
225
|
|
|
226
|
-
response = requests.post(url, headers=headers, json
|
|
226
|
+
response = requests.post(url, headers=headers, data=json.dumps(payload))
|
|
227
227
|
debug_log(config, f"send_lark_webclient: response status: {response.status_code}")
|
|
228
228
|
if response.status_code != 200:
|
|
229
229
|
error_msg = f"Lark WebClient response: {response.status_code}"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|