Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
ffm-baseline
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ML
ffm-baseline
Commits
8ed29868
Commit
8ed29868
authored
Nov 06, 2019
by
张彦钊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
d3e160fa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
16 deletions
+12
-16
delete_key.py
delete_key.py
+4
-9
es_tag.py
es_tag.py
+8
-7
kv.py
kv.py
+0
-0
No files found.
monitor
.py
→
delete_key
.py
View file @
8ed29868
...
...
@@ -100,18 +100,13 @@ def topic_key():
cursor
=
new_cursor
def
search
():
r
=
redis
.
StrictRedis
.
from_url
(
'redis://:ReDis!GmTx*0aN
6@172.16.40.13
3:6379'
)
r
=
redis
.
StrictRedis
.
from_url
(
'redis://:ReDis!GmTx*0aN
9@172.16.40.17
3:6379'
)
cursor
=
0
while
True
:
new_cursor
,
keys_list
=
r
.
scan
(
cursor
,
"
*"
,
10
000
)
new_cursor
,
keys_list
=
r
.
scan
(
cursor
,
"
device:latest:action:tag:names:update:flag:*"
,
1
000
)
delete_keys
=
[]
for
i
in
keys_list
:
if
r
.
ttl
(
i
)
==
-
1
:
delete_keys
.
append
(
i
)
if
len
(
delete_keys
)
==
100
:
print
(
delete_keys
)
break
print
(
len
(
keys_list
))
r
.
delete
(
*
keys_list
)
# 循环一遍后结束
if
new_cursor
==
0
:
...
...
es_tag.py
View file @
8ed29868
...
...
@@ -56,13 +56,14 @@ def es_query(doc, body, offset, size, es=None):
from_
=
offset
,
size
=
size
)
# number = res["hits"]["total"]
total
=
res
[
"hits"
][
"hits"
]
print
(
total
)
r
=
[]
for
i
in
total
:
r
.
append
(
i
[
'_source'
][
'id'
])
return
r
number
=
res
[
"hits"
][
"total"
]
return
number
# total = res["hits"]["hits"]
# print(total)
# r = []
# for i in total:
# r.append(i['_source']['id'])
# return r
def
answer
():
...
...
kv.py
deleted
100644 → 0
View file @
d3e160fa
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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