Commit 398bff5d authored by 李小芳's avatar 李小芳

Merge branch 'save_offset_to_redis' into 'master'

修改次数

See merge request !10
parents 9b2e6460 0cb7322a
...@@ -60,20 +60,20 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty ...@@ -60,20 +60,20 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty
action_num = random.randint(5, 10) action_num = random.randint(5, 10)
if num_days <= 15 and num_days > 1 and action_type in ("follow", "click") and int(content_level) < 3: if num_days <= 15 and num_days > 1 and action_type in ("follow", "click") and int(content_level) < 3:
action_num = random.randint(0, 1) action_num = random.randint(1, 2)
if num_days <= 15 and num_days > 1 and action_type in ("follow") and int(content_level) >= 3: if num_days <= 15 and num_days > 1 and action_type in ("follow") and int(content_level) >= 3:
action_num = random.randint(0, 5) action_num = random.randint(1, 5)
if num_days == 1 and action_type in ("click") and int(content_level) >= 3: if num_days == 1 and action_type in ("click") and int(content_level) >= 3:
action_num = random.randint(6, 12) action_num = random.randint(6, 12)
if num_days <= 15 and num_days > 1 and action_type in ("click") and int(content_level) >= 3: if num_days <= 15 and num_days > 1 and action_type in ("click") and int(content_level) >= 3:
action_num = random.randint(0, 6) action_num = random.randint(1, 6)
if num_days >= 1 and num_days <= 6 and action_type in ("comment"): if num_days >= 1 and num_days <= 6 and action_type in ("comment"):
if int(content_level) <= 3: if int(content_level) <= 3:
action_num = random.randint(0, 1) action_num = random.randint(1, 2)
else: else:
action_num = random.randint(2, 4) action_num = random.randint(2, 4)
...@@ -104,24 +104,24 @@ def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', conte ...@@ -104,24 +104,24 @@ def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', conte
lastday = datetime.datetime(now.year, now.month, now.day, 23, 0, 0) lastday = datetime.datetime(now.year, now.month, now.day, 23, 0, 0)
add_number = 0 add_number = 0
if num_days > 15 and action_type in ("follow"): if num_days > 15 and action_type in ("follow"):
action_num = random.randint(0, 2) action_num = random.randint(1, 2)
add_number = 10 add_number = 10
elif num_days > 15 and action_type in ("click"): elif num_days > 15 and action_type in ("click"):
if content_level < 3: if content_level < 3:
action_num = random.randint(0, 1) action_num = random.randint(1, 2)
add_number = 6 add_number = 6
else: else:
action_num = random.randint(0, 2) action_num = random.randint(1, 2)
add_number = 5 add_number = 5
elif num_days > 6 and action_type in ("comment"): elif num_days > 6 and action_type in ("comment"):
if content_level <= 3: if content_level <= 3:
action_num = random.randint(0, 1) action_num = 1
add_number = 10 add_number = 10
else: else:
action_num = random.randint(0, 2) action_num = random.randint(1, 2)
add_number = 10 add_number = 10
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment