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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycommonlog
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Unified logging and alerting library for Python.
5
5
  Home-page: https://github.com/alvianhanif/pycommonlog
6
6
  Author: Alvian Rahman Hanif
@@ -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, RedisConfigError
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 RedisConfigError:
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 RedisConfigError:
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 RedisConfigError:
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 RedisConfigError:
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=payload)
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}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pycommonlog
3
- Version: 0.2.5
3
+ Version: 0.2.7
4
4
  Summary: Unified logging and alerting library for Python.
5
5
  Home-page: https://github.com/alvianhanif/pycommonlog
6
6
  Author: Alvian Rahman Hanif
File without changes
File without changes
File without changes
File without changes