def run()

in codes/component/logger_sample/src/handler.py [0:0]


def run():
    logger.info('------------------------run-------------------')
    load_environ()

    sample = load_sample_data(_sample_file_name)
    topic = '{}/{}'.format(_topic, _thing_name)

    count = 0
    sleep_time_in_sec = int(os.environ.get('SLEEP_TIME', '30'))
    while True:
        count = count + 1
        message = create_data(sample, count)

        publish_data(topic, message)

        logger.info('--->run: sleep- {}'.format(sleep_time_in_sec))
        time.sleep(sleep_time_in_sec)