def generate_times():
    now = datetime.datetime.now()
next_time = datetime.datetime(now.year, now.month, now.day, now.hour, now.
    minute)
while True:
    yield next_time
next_time += datetime.timedelta(minute=1)

def past_times():
    for time in generate_times():
        while time > datetime.datetime.now() - datetime.timedelta(minute=1):
            time.sleep(1.0)
Регистрация бесконечных данных через периодические интервалы