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
alpha
physical
Commits
dfe6a960
Commit
dfe6a960
authored
5 years ago
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
e08a81fd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
tasks.py
injection/data_sync/tasks.py
+5
-2
No files found.
injection/data_sync/tasks.py
View file @
dfe6a960
...
...
@@ -109,12 +109,13 @@ def auto_click(pk_list):
exec_count
=
0
try
:
now
=
datetime
.
datetime
.
now
()
yes_time_str
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id in "
+
str
(
tuple
(
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time
> '
%
s' "
%
now
)
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time
LIKE '
%%%%%
s
%%%%
' "
%
yes_time_str
)
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
...
...
@@ -163,12 +164,14 @@ def auto_reply(pk_list):
exec_count
=
0
try
:
now
=
datetime
.
datetime
.
now
()
yes_time_str
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
pc
=
pymysql
.
connect
(
host
=
host
,
user
=
user
,
passwd
=
passwd
,
db
=
db
,
port
=
3306
)
cursor
=
pc
.
cursor
()
cursor
.
execute
(
"SELECT id,user_id FROM topic WHERE id in "
+
str
(
tuple
(
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time > '
%
s' "
%
now
)
pk_list
))
+
" and user_id in (select user_id from user_extra where is_shadow = 0) and create_time LIKE '
%%%%%
s
%%%%
' "
%
(
yes_time_str
))
data
=
cursor
.
fetchall
()
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
...
...
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