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
bedeb54e
authored
Sep 15, 2023
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
只需要digikey的token
parent
1105c7cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
14 deletions
token_server.py
token_server.py
View file @
bedeb54e
...
...
@@ -13,8 +13,8 @@ import lib
import
token_lib
from
log_manage
import
get_logger
#
去掉digikey,mouser
的爬虫token
process_list
=
[
'
digikey'
,
"mouser"
]
#
需要
的爬虫token
process_list
=
[
'
apidigikey'
]
logger
=
get_logger
(
'app'
)
...
...
@@ -55,18 +55,17 @@ def init_task(queue):
if
issubclass
(
cls
[
1
],
token_lib
.
BaseTokenCrawler
):
platform
=
getattr
(
module
,
"PLATFORM"
)
if
platform
in
process_list
:
continue
level
=
getattr
(
module
,
"LEVEL"
,
DEFAULT_INTERVAL
)
main_num
=
getattr
(
module
,
"MAIN_NUM"
,
-
1
)
back_num
=
getattr
(
module
,
"BACK_NUM"
,
-
1
)
mode
=
getattr
(
module
,
"MODE"
,
"redis"
)
thread_num
=
getattr
(
module
,
"THREAD_NUM"
,
5
)
obj
=
cls
[
1
](
platform
,
level
,
main_num
,
logger
,
back_num
,
mode
,
thread_num
)
cur_stamp
=
time
.
time
()
queue
.
put
((
cur_stamp
,
obj
,
True
))
logger
.
info
(
"Adding platform:
%
s, level=
%
s, main_num=
%
s, back_num=
%
s, mode=
%
s, thread_num=
%
s"
,
platform
,
level
,
main_num
,
back_num
,
mode
,
thread_num
)
level
=
getattr
(
module
,
"LEVEL"
,
DEFAULT_INTERVAL
)
main_num
=
getattr
(
module
,
"MAIN_NUM"
,
-
1
)
back_num
=
getattr
(
module
,
"BACK_NUM"
,
-
1
)
mode
=
getattr
(
module
,
"MODE"
,
"redis"
)
thread_num
=
getattr
(
module
,
"THREAD_NUM"
,
5
)
obj
=
cls
[
1
](
platform
,
level
,
main_num
,
logger
,
back_num
,
mode
,
thread_num
)
cur_stamp
=
time
.
time
()
queue
.
put
((
cur_stamp
,
obj
,
True
))
logger
.
info
(
"Adding platform:
%
s, level=
%
s, main_num=
%
s, back_num=
%
s, mode=
%
s, thread_num=
%
s"
,
platform
,
level
,
main_num
,
back_num
,
mode
,
thread_num
)
class
Worker
(
Thread
):
...
...
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