Commit 7993b00b authored by lixiaofang's avatar lixiaofang

auto_vest

parent 7eb1a12f
......@@ -24,6 +24,8 @@ def kafka_consum(topic_name=None):
consumser_obj = KafkaConsumer(topic_name, bootstrap_servers=[settings.KAFKA_BROKER_LIST], enable_auto_commit=False,
auto_commit_interval_ms=100, group_id="vest")
consumser_obj.subscribe([topic_name, ])
consumser_obj.seek()
try:
while True:
msg_dict = consumser_obj.poll(timeout_ms=100, max_records=50)
......
......@@ -94,6 +94,8 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty
def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', action_type=None, content_level=0,
content_day_need_add_one_day=False):
try:
if num_days == None:
return []
##比较当前时间和最后一次创建时间的差
now = datetime.datetime.now()
zeroday = datetime.datetime(now.year, now.month, now.day, 10, 0, 0)
......
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