コード例 #1
0
def init_app():
    globv.initConfigFile()
    initDBSettings()
    dump.update()
    ldbutil.clear()
    globv.update_logger.info('=' * 20 + 'video record web server' + '=' * 20)
    globv.update_logger.info('=' * 20 + '  licensed by tongshi  ' + '=' * 20)
コード例 #2
0
def kill_all_channel():
    list = ldbutil.get_channels()

    for channel in list:
        kill(channel)

    ldbutil.clear()
コード例 #3
0
def init_app():
    globv.initConfigFile()
    initDBSettings()
    dump.update()
    ldbutil.clear()
    globv.update_logger.info('=' * 20 + 'video record web server' + '=' * 20)
    globv.update_logger.info('=' * 20 + '  licensed by tongshi  ' + '=' * 20)


def after_app():
    dump.update_flag = False
    print('called here')


if __name__ == '__main__':
    globv.initConfigFile()
    initDBSettings()
    dump.update()
    ldbutil.clear()
    globv.update_logger.info('=' * 20 + 'video record web server' + '=' * 20)
    globv.update_logger.info('=' * 20 + '  licensed by tongshi  ' + '=' * 20)
    with (Path(globv.cur_path) / 'tsserver.pid').open('w') as f:
        f.write(str(os.getpid()))
    t = threading.Timer(5 * 60, restore_channels)
    t.setDaemon(True)
    t.start()
    app.run(host='0.0.0.0', port=globv.PORT, debug=False)
    dump.update_flag = False
    print('called here')