Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
S
saturn
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
1
Merge Requests
1
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
alpha
saturn
Commits
19b434b2
Commit
19b434b2
authored
6 years ago
by
zhanglu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hotfix/pin' into 'master'
pin抓取 See merge request
!37
parents
95cbdda7
41446ab6
master
deploy/like-prod
deploy/like-stage
deploy/like-test
dev
like-pre/r01
test
2 merge requests
!41
fix
,
!79
Haow/dev
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
topic.py
api/views/topic.py
+10
-3
No files found.
api/views/topic.py
View file @
19b434b2
...
@@ -9,7 +9,7 @@ from alpha_types.venus import ERROR as CODES
...
@@ -9,7 +9,7 @@ from alpha_types.venus import ERROR as CODES
from
alpha_types.venus
import
GRAP_PLATFORM
from
alpha_types.venus
import
GRAP_PLATFORM
ins_account
_cache
=
"ins_account_cache"
topic_id
_cache
=
"ins_account_cache"
class
CreateTopicForBatch
(
BaseView
):
class
CreateTopicForBatch
(
BaseView
):
...
@@ -69,12 +69,19 @@ class CreateTopicForBatch(BaseView):
...
@@ -69,12 +69,19 @@ class CreateTopicForBatch(BaseView):
not_exists_ids
=
[]
not_exists_ids
=
[]
topic_list
=
[]
topic_list
=
[]
if
platform
==
GRAP_PLATFORM
.
INS
:
if
platform
==
GRAP_PLATFORM
.
INS
:
cache_key
=
topic_id_cache
elif
platform
==
GRAP_PLATFORM
.
PIN
:
cache_key
=
topic_id_cache
+
":2"
else
:
return
if
platform
in
(
GRAP_PLATFORM
.
INS
,
GRAP_PLATFORM
.
PIN
):
for
item
in
topics
:
for
item
in
topics
:
_id
=
item
.
get
(
"id"
)
_id
=
item
.
get
(
"id"
)
if
not
_id
:
if
not
_id
:
continue
continue
exists
=
ins_cache
.
sismember
(
ins_account_cache
,
_id
)
exists
=
ins_cache
.
sismember
(
cache_key
,
_id
)
if
exists
:
if
exists
:
continue
continue
...
@@ -121,7 +128,7 @@ class CreateTopicForBatch(BaseView):
...
@@ -121,7 +128,7 @@ class CreateTopicForBatch(BaseView):
# 将已经跑了的数据添加到缓存
# 将已经跑了的数据添加到缓存
if
not_exists_ids
:
if
not_exists_ids
:
ins_cache
.
sadd
(
ins_account_cache
,
*
not_exists_ids
)
ins_cache
.
sadd
(
cache_key
,
*
not_exists_ids
)
return
self
.
ok
(
data
=
result
)
return
self
.
ok
(
data
=
result
)
...
...
This diff is collapsed.
Click to expand it.
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