fix
This commit is contained in:
parent
9aa503125f
commit
c5afe12db7
@ -8,7 +8,7 @@ from ops.mmysql import MysqlBase
|
||||
import random
|
||||
import requests
|
||||
import pdb
|
||||
define_logger("/data/logs/init_first_ad_channel.log")
|
||||
define_logger("/data/logs/get_news.log")
|
||||
log = logging.getLogger(__name__)
|
||||
TimeDelay = 60*60
|
||||
|
||||
@ -116,8 +116,8 @@ class InitFirstAD():
|
||||
if data:
|
||||
line = len(data)
|
||||
nums = int(line * ratio / 100)
|
||||
if ratio != 100:
|
||||
print(f"all={line} nums={nums}")
|
||||
if int(ratio) != int(100):
|
||||
print(f"all={line} nums={nums} ratio={ratio}")
|
||||
if nums:
|
||||
return random.sample(data, nums)
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user