Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
crawler
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
backend
crawler
Commits
eb27a82b
Commit
eb27a82b
authored
Sep 21, 2020
by
litaolemo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
45bf1cf9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
update_data_in_target_releasers_multi_process_by_date_from_redis.py
...a_in_target_releasers_multi_process_by_date_from_redis.py
+4
-3
No files found.
crawler_sys/framework/update_data_in_target_releasers_multi_process_by_date_from_redis.py
View file @
eb27a82b
...
...
@@ -60,11 +60,11 @@ parser.add_argument('-index', '--es_index', default='crawler-data-raw', type=str
help
=
(
'assign a es_index to write into, default to crawler-data-raw'
))
parser
.
add_argument
(
'-g'
,
'--output_to_es_register'
,
default
=
'True'
,
type
=
str
,
help
=
(
'Write data into es or not, default to True'
))
parser
.
add_argument
(
'-processes'
,
'--processes_num'
,
default
=
8
,
type
=
int
,
parser
.
add_argument
(
'-processes'
,
'--processes_num'
,
default
=
4
,
type
=
int
,
help
=
(
'Processes number to be used in multiprocessing'
))
parser
.
add_argument
(
'-exit_hour'
,
'--exit_hour'
,
default
=
22
,
type
=
int
,
help
=
(
'Processes number to be used in multiprocessing'
))
parser
.
add_argument
(
'-thead'
,
'--thead_num'
,
default
=
5
,
type
=
int
,
parser
.
add_argument
(
'-thead'
,
'--thead_num'
,
default
=
4
,
type
=
int
,
help
=
(
'thead_num number to be used in multiprocessing'
))
parser
.
add_argument
(
'-v'
,
'--video'
,
default
=
"False"
,
type
=
str
,
help
=
(
'Is or not run video_page_crawler'
))
...
...
@@ -251,7 +251,7 @@ def start_crawler(processe,name):
for
count
in
range
(
args
.
thead_num
):
# single_thead(processe,name)
t
=
threading
.
Thread
(
target
=
single_thead
,
name
=
str
(
count
),
args
=
(
str
(
processe
),
name
))
t
.
setDaemon
(
False
)
#
t.setDaemon(False)
t
.
start
()
...
...
@@ -267,6 +267,7 @@ if __name__ == "__main__":
future
=
executor
.
submit
(
start_crawler
,
processe
,
name
)
futures
.
append
(
future
)
print
(
'Processe
%
s start'
%
processe
)
executor
.
shutdown
(
True
)
# while True:
# now = datetime.datetime.now()
# if now.hour >= exit_hour:
...
...
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