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()
评论列表
文章目录