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
0549e555
Commit
0549e555
authored
Apr 24, 2019
by
lixiaofang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add
parent
6a1d7980
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
tasks.py
injection/data_sync/tasks.py
+8
-7
No files found.
injection/data_sync/tasks.py
View file @
0549e555
...
@@ -18,6 +18,9 @@ from linucb.utils.register_user_tag import RegisterUserTag
...
@@ -18,6 +18,9 @@ from linucb.utils.register_user_tag import RegisterUserTag
from
injection.data_sync.get_session
import
get_comments
,
click
,
login
,
reply
from
injection.data_sync.get_session
import
get_comments
,
click
,
login
,
reply
from
injection.data_sync.get_session
import
host
,
user
,
passwd
,
db
from
injection.data_sync.get_session
import
host
,
user
,
passwd
,
db
exec_count_click
=
0
exec_count
=
0
@shared_task
@shared_task
def
write_to_es
(
es_type
,
pk_list
,
use_batch_query_set
=
False
):
def
write_to_es
(
es_type
,
pk_list
,
use_batch_query_set
=
False
):
...
@@ -106,7 +109,7 @@ def sync_user_similar_score():
...
@@ -106,7 +109,7 @@ def sync_user_similar_score():
def
auto_click
(
pk_list
):
def
auto_click
(
pk_list
):
logging
.
info
(
"get--------auto_click--------------:
%
s"
%
pk_list
)
logging
.
info
(
"get--------auto_click--------------:
%
s"
%
pk_list
)
exec_count
=
0
exec_count
_click
=
0
try
:
try
:
now
=
datetime
.
datetime
.
now
()
now
=
datetime
.
datetime
.
now
()
yes_time_str
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
yes_time_str
=
now
.
strftime
(
'
%
Y-
%
m-
%
d'
)
...
@@ -120,7 +123,6 @@ def auto_click(pk_list):
...
@@ -120,7 +123,6 @@ def auto_click(pk_list):
topic_id_list
=
list
(
data
)
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
pc
.
close
()
exec_count
=
0
if
topic_id_list
:
if
topic_id_list
:
try
:
try
:
def
fun_timer
():
def
fun_timer
():
...
@@ -129,17 +131,17 @@ def auto_click(pk_list):
...
@@ -129,17 +131,17 @@ def auto_click(pk_list):
click
(
cookies
,
topic_id_list
[
0
])
click
(
cookies
,
topic_id_list
[
0
])
global
timer
global
timer
global
exec_count
global
exec_count
_click
exec_count
+=
1
exec_count
_click
+=
1
if
exec_count
==
1
:
if
exec_count
_click
==
1
:
logging
.
info
(
"----------2-----------"
)
logging
.
info
(
"----------2-----------"
)
# sleep_time = random.randint(300, 540)
# sleep_time = random.randint(300, 540)
sleep_time
=
30
sleep_time
=
30
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
=
threading
.
Timer
(
sleep_time
,
fun_timer
)
timer
.
start
()
timer
.
start
()
if
exec_count
==
2
:
if
exec_count
_click
==
2
:
# sleep_time = random.randint(1000, 1900)
# sleep_time = random.randint(1000, 1900)
logging
.
info
(
"----------3-----------"
)
logging
.
info
(
"----------3-----------"
)
sleep_time
=
50
sleep_time
=
50
...
@@ -176,7 +178,6 @@ def auto_reply(pk_list):
...
@@ -176,7 +178,6 @@ def auto_reply(pk_list):
topic_id_list
=
list
(
data
)
topic_id_list
=
list
(
data
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
logging
.
info
(
"Database version :
%
s "
%
topic_id_list
)
pc
.
close
()
pc
.
close
()
exec_count
=
0
if
topic_id_list
:
if
topic_id_list
:
try
:
try
:
...
...
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