Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
tas_token_server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
378fc048
authored
Dec 04, 2025
by
刘豪
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
digikey update
parent
e1ce57fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletions
lib/apidigikey.py
lib/apidigikey.py
View file @
378fc048
...
...
@@ -116,13 +116,14 @@ class DGTokenCrawler(token_lib.BaseTokenCrawler):
}
resp
=
requests
.
post
(
p_url
,
headers
=
p_headers
,
data
=
p_data
,
timeout
=
60
)
self
.
logger
.
info
(
"digikey token 返回内容:{}"
.
format
(
resp
.
text
))
token_json
=
resp
.
json
(
)
token_json
=
json
.
loads
(
resp
.
text
)
if
not
token_json
.
get
(
'access_token'
,
''
):
self
.
logger
.
info
(
"返回内容异常,休眠30s"
)
time
.
sleep
(
30
)
# 说明digikey接口内容返回异常,尝试再次获取,不确定refresh_token经过一次请求后返回内容异常时是否失效,需观察,如果失效的话,那么重试就没有任何意义了
self
.
get_token_by_refresh_token
(
count
)
else
:
self
.
logger
.
info
(
"返回内容正常"
)
return
token_json
except
Exception
:
# 通常是超时了,休眠1分钟后重新尝试获取,但是超时的报错不确定refresh_token是否就会因此失效,所以还得观察
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment