Skip to content

Commit

Permalink
hotfix pr image
Browse files Browse the repository at this point in the history
  • Loading branch information
freeziyou committed Mar 4, 2024
1 parent 6c3a4b7 commit 1114775
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/tasks/lark/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def gen_pr_card_by_pr(
repo_url=repo_url,
id=pr.pull_request_number,
title=pr.title,
description=pr.description,
description=description,
base=pr.extra.get("base", {}),
head=pr.extra.get("head", {}),
status=status,
Expand Down Expand Up @@ -380,7 +380,7 @@ def send_pull_request_card(pull_request_id: str):

first_message_result = bot.reply(
message_id,
# TODO 第一条话题消息,直接放repo_url
# 第一条话题消息,直接放repo_url
FeishuTextMessage(
f"{users} {repo_url}/pull/{pr.pull_request_number}"
),
Expand Down
4 changes: 3 additions & 1 deletion server/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ def process_image(url, bot):
@stalecache(expire=3600, stale=600)
def upload_image(url, bot):
logging.info("upload image: %s", url)
response = httpx.get(url, follow_redirects=True)
response = httpx.get(
url, follow_redirects=True, timeout=15
) # Increase the timeout to 30 seconds
if response.status_code == 200:
# 函数返回值: iamg_key 存到缓存中
img_key = upload_image_binary(response.content, bot)
Expand Down

0 comments on commit 1114775

Please sign in to comment.