Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
lichenggang
/
tas_monitor
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
05c756a0
authored
Nov 21, 2019
by
陈森彬
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'master' of
ssh://119.23.72.7:22611/lic/tas_monitor
into dev2
parents
34c195bb
b7720fe9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
crawler_process.py
utils/mysql.py
crawler_process.py
View file @
05c756a0
...
@@ -21,9 +21,9 @@ ichunt_elk = Elasticsearch(host="127.0.0.1", port=9200, timeout=20)
...
@@ -21,9 +21,9 @@ ichunt_elk = Elasticsearch(host="127.0.0.1", port=9200, timeout=20)
def
get_process_task
(
task_code
):
def
get_process_task
(
task_code
):
keys
=
task_redis
.
keys
(
task_code
+
'*'
)
keys
=
task_redis
.
keys
(
task_code
+
'
_
*'
)
keys_len
=
sum
([
task_redis
.
llen
(
k
)
for
k
in
keys
])
keys_len
=
sum
([
task_redis
.
llen
(
k
)
for
k
in
keys
])
abnormal_keys
=
task_redis
.
keys
(
'abnormal_'
+
task_code
+
'*'
)
abnormal_keys
=
task_redis
.
keys
(
'abnormal_'
+
task_code
+
'
_
*'
)
abnormal_keys_len
=
sum
([
task_redis
.
llen
(
k
)
for
k
in
abnormal_keys
])
abnormal_keys_len
=
sum
([
task_redis
.
llen
(
k
)
for
k
in
abnormal_keys
])
return
keys_len
,
abnormal_keys_len
return
keys_len
,
abnormal_keys_len
...
...
utils/mysql.py
View file @
05c756a0
...
@@ -38,7 +38,7 @@ class MySqlOperator:
...
@@ -38,7 +38,7 @@ class MySqlOperator:
def
update_process
(
self
,
p
):
def
update_process
(
self
,
p
):
with
self
.
db
.
cursor
()
as
cursor
:
with
self
.
db
.
cursor
()
as
cursor
:
sql
=
"""
sql
=
"""
UPDATE lie_spider_board SET run_time=
%(run_time)
s, remain_task=
%(remain_task)
s,
UPDATE lie_spider_board SET run_time=
%(run_time)
s, remain_task=
%(remain_task)
s,
concurrency=
%(concurrency)
s,
remain_wrong_task=
%(remain_wrong_task)
s, wrong_radio=
%(wrong_radio)
s WHERE unique_code=
%(unique_code)
s
remain_wrong_task=
%(remain_wrong_task)
s, wrong_radio=
%(wrong_radio)
s WHERE unique_code=
%(unique_code)
s
"""
"""
cursor
.
execute
(
sql
,
p
)
cursor
.
execute
(
sql
,
p
)
...
...
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