Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
physical
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
钟尚武
physical
Commits
e12d0366
Commit
e12d0366
authored
Aug 13, 2019
by
段英荣
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'update_vest' into 'master'
Update vest See merge request
alpha/physical!415
parents
cba8d966
e750ae2e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
auto_user_id.py
vest/request/auto_user_id.py
+2
-1
vest_click_reply.py
vest/vest_majiauser/vest_click_reply.py
+6
-4
No files found.
vest/request/auto_user_id.py
View file @
e12d0366
import
pymysql
import
traceback
import
logging
import
json
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.cache
import
redis_client
from
libs.error
import
logging_exception
...
...
@@ -38,7 +39,7 @@ def auto_user_id():
for
i
in
data
:
file
.
write
(
str
(
i
[
0
]))
file
.
write
(
"
\n
"
)
redis_client
.
set
(
"get_user_id_data"
,
data
)
redis_client
.
set
(
"get_user_id_data"
,
json
.
dumps
(
data
)
)
except
:
logging_exception
()
...
...
vest/vest_majiauser/vest_click_reply.py
View file @
e12d0366
...
...
@@ -3,7 +3,9 @@ import pymysql
import
random
import
traceback
import
logging
import
json
import
datetime
from
libs.cache
import
redis_client
from
vest.request.auto_request
import
get_offline_comment
from
vest.request.auto_request
import
host
,
user
,
db
,
passwd
from
libs.error
import
logging_exception
...
...
@@ -60,14 +62,14 @@ def vest_click_reply():
logging
.
info
(
"get majia data11111111111"
)
now
=
datetime
.
datetime
.
now
()
yes_time
=
now
-
datetime
.
timedelta
(
minutes
=
5
)
user_data
=
open
(
"/srv/apps/physical/vest/data/user_id.txt"
,
"r"
)
data
=
json
.
loads
(
redis_client
.
get
(
"get_user_id_data"
)
)
user_list
=
[]
for
i
in
user_data
.
readlines
()
:
user_list
.
append
(
i
)
for
i
in
data
:
user_list
.
append
(
i
[
0
]
)
topic_id
=
get_data
(
yes_time
,
now
)
if
topic_id
:
for
id
in
topic_id
:
rand_num
=
random
.
randint
(
1
,
3
)
rand_num
=
random
.
randint
(
0
,
4
)
for
i
in
range
(
rand_num
):
num
=
random
.
randint
(
0
,
len
(
user_list
)
-
1
)
user_id
=
user_list
[
num
]
...
...
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