dagster-dingtalk 0.1.29__py3-none-any.whl → 0.1.30__py3-none-any.whl
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.
dagster_dingtalk/app_client.py
CHANGED
@@ -71,10 +71,10 @@ class DingTalkClient:
|
|
71
71
|
else:
|
72
72
|
return {}
|
73
73
|
|
74
|
-
def __file_cache_write(self):
|
74
|
+
def __file_cache_write(self, access_token_cache: dict):
|
75
75
|
try:
|
76
76
|
with open(self.__access_token_file_cache, 'wb') as f:
|
77
|
-
f.write(pickle.dumps(
|
77
|
+
f.write(pickle.dumps(access_token_cache))
|
78
78
|
except Exception as e:
|
79
79
|
logging.error(f"AccessToken 缓存写入失败: {e}")
|
80
80
|
|
@@ -93,16 +93,17 @@ class DingTalkClient:
|
|
93
93
|
json={"appKey": self.__client_id, "appSecret": self.__client_secret},
|
94
94
|
).json()
|
95
95
|
# 提前 1 分钟进行续期
|
96
|
-
|
96
|
+
access_token_cache = {
|
97
97
|
"access_token": response.get("accessToken"),
|
98
98
|
"expire_in": response.get("expireIn") + int(time.time()) - 60
|
99
99
|
}
|
100
|
-
self.
|
100
|
+
self.__access_token_cache = access_token_cache
|
101
|
+
self.__file_cache_write(self.__access_token_cache)
|
101
102
|
except Exception as e:
|
102
103
|
logging.error(f"AccessToken 获取失败: {e}")
|
103
104
|
raise
|
104
105
|
|
105
|
-
return
|
106
|
+
return access_token_cache["access_token"]
|
106
107
|
|
107
108
|
def oapi(self, method: str, path: str, **kwargs) -> httpx.Response:
|
108
109
|
params = kwargs.get("params", {})
|
@@ -1,9 +1,9 @@
|
|
1
1
|
dagster_dingtalk/__init__.py,sha256=Qw145M6Igl-NXuFUS-SHpKxyqvVboQAksXvhBnv0wBM,425
|
2
|
-
dagster_dingtalk/app_client.py,sha256=
|
2
|
+
dagster_dingtalk/app_client.py,sha256=dCQo0GMkVnEhpMHrbTm4OmCEYfJrrX19XCEVih5O-dg,36052
|
3
3
|
dagster_dingtalk/operations.py,sha256=yH_rXJpWc8rwzkiJqjqHKy5iIED0Xi3qbSOv6SVr-eA,3923
|
4
4
|
dagster_dingtalk/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
dagster_dingtalk/resources.py,sha256=RtoK-lbHKknzYDRq1bredLMxHm0GhycJ1IxQ7hjgLBw,17868
|
6
6
|
dagster_dingtalk/version.py,sha256=7jeKY88H3WyDN-Lrs5HYlAPbc4flvLTYlLgkgnZOy-g,26
|
7
|
-
dagster_dingtalk-0.1.
|
8
|
-
dagster_dingtalk-0.1.
|
9
|
-
dagster_dingtalk-0.1.
|
7
|
+
dagster_dingtalk-0.1.30.dist-info/METADATA,sha256=M2rEfThb0FR2vGAIGzTJ1hSncjw9rVPYLF1c-q4yci0,7758
|
8
|
+
dagster_dingtalk-0.1.30.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
dagster_dingtalk-0.1.30.dist-info/RECORD,,
|
File without changes
|