Skip to content

Commit 4c31597

Browse files
committed
fix: remove feishu requests
1 parent 42a6428 commit 4c31597

File tree

4 files changed

+3
-46
lines changed

4 files changed

+3
-46
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ S3 支持使用虚拟域名作为 endpoint,即可以将 region 或者 bucket
152152
- S3_PREFIX: 选填,要存储的前缀
153153
- S3_SIGNATURE_VERSION: 选填,签名版本,使用阿里云 oss 时,需要设置为"s3",minio 无需处理
154154

155-
- FEISHU_NOTIFY_TOKEN: 选填,飞书推送 token,为空时不推送
156-
- FEISHU_NOTIFY_TITLE: 选填,飞书推送标题,FEISHU_NOTIFY_TOKEN 为空时无效,例如 haiviv cn,此时飞书通知的标题为 `haivivi cn mongodb 备份出错`
157-
158155
### restore
159156

160157
- S3_ENABLE: 选填,是否从 S3 中进行恢复,true 表示启用

docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ RUN apt-get update && \
55
apt-get install -y zip psmisc python3 python3-pip
66

77
RUN pip3 install --upgrade pip
8-
RUN pip3 install boto3 requests
8+
RUN pip3 install boto3
99

1010
WORKDIR /app
1111
ADD . /app

docker/backup.py

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
"S3_REGION",
3737
"S3_BUCKET",
3838
"S3_PREFIX",
39-
"FEISHU_TOKEN",
4039
]
4140

4241
for key in must_inputs:
@@ -95,13 +94,6 @@ def check_bool(key):
9594
os.environ["S3_SIGNATURE_VERSION"] if check_var("S3_SIGNATURE_VERSION") else None
9695
)
9796

98-
feishu_notify_token = (
99-
os.environ["FEISHU_NOTIFY_TOKEN"] if check_var("FEISHU_NOTIFY_TOKEN") else None
100-
)
101-
feishu_notify_title = (
102-
os.environ["FEISHU_NOTIFY_TITLE"] if check_var("FEISHU_NOTIFY_TITLE") else None
103-
)
104-
10597
# 计算当前日期,按照 年月日时分 格式
10698
date = (datetime.now() + timedelta(hours=8)).strftime("%Y%m%d%H%M%S")
10799

@@ -245,34 +237,6 @@ def upload_s3(prefix):
245237
print(f"Deleted s3 old backup files: {keys_to_remove}")
246238

247239

248-
def send_feishu_notify(msg):
249-
data = {
250-
"msg_type": "post",
251-
"content": {
252-
"post": {
253-
"zh_cn": {
254-
"title": f"{feishu_notify_title} mongodb 备份出错",
255-
"content": [
256-
[
257-
{
258-
"tag": "text",
259-
"text": msg,
260-
}
261-
]
262-
],
263-
}
264-
}
265-
},
266-
}
267-
try:
268-
requests.post(
269-
f"https://open.feishu.cn/open-apis/bot/v2/hook/{feishu_notify_token}",
270-
json=data,
271-
)
272-
except Exception as e:
273-
print("Feishu notify error:", e)
274-
275-
276240
try:
277241
if not os.path.exists(backup_path):
278242
os.makedirs(backup_path)
@@ -300,8 +264,4 @@ def send_feishu_notify(msg):
300264

301265
except Exception as e:
302266
print("backup error:", e)
303-
304-
if feishu_notify_token:
305-
send_feishu_notify(f"错误信息: {e}")
306-
307267
sys.exit()

helm-chart/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.6.1
18+
version: 1.6.2
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to
2222
# follow Semantic Versioning. They should reflect the version the application is using.
2323
# It is recommended to use it with quotes.
24-
appVersion: "1.6.1"
24+
appVersion: "1.6.2"

0 commit comments

Comments
 (0)