Skip to content

Commit

Permalink
Modify redis cache key. Ref #1
Browse files Browse the repository at this point in the history
  • Loading branch information
buaabarty committed Apr 3, 2023
1 parent 8465c97 commit 6492f3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions wechat_auto_reply/message_handler/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
chatbots = ExpiringDict(1800) # set the expiring time of conversation as 1800 seconds

def set_access_token(token, expires_in):
redis_client.set('wecom_access_token_jsk', token, ex=expires_in)
redis_client.set('wecom_access_token_bot', token, ex=expires_in)

def get_access_token():
return redis_client.get('wecom_access_token_jsk')
return redis_client.get('wecom_access_token_bot')

def request_access_token(corp_id, corp_secret):
url = f'https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid={corp_id}&corpsecret={corp_secret}'
Expand Down

0 comments on commit 6492f3b

Please sign in to comment.