tasks.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:hardware-lab 作者: Buzzvil 项目源码 文件源码
def update_public_url():
    response = requests.get('http://localhost:4040/api/tunnels')

    public_url = response.json()['tunnels'][0]['public_url']
    # TODO: ???? http/https ??? ???? ???? ? ??? ?? ???? - by zune
    public_url = public_url.replace('http://', 'https://')
    logger.info('public url {}'.format(public_url))

    PublicUrl(
        machine_id=get_machine_id(),
        location=settings.AC_LOCATION,
        public_url=public_url,
        updated_at=arrow.utcnow().datetime,
        ttl=arrow.utcnow().shift(days=1).datetime,
        hostname=os.environ.get('HOSTNAME') or socket.gethostname(),
    ).save()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号