def __init__(self, api_key, user_agent, base_url, entity, project, run_id):
self._endpoint = "{base}/{entity}/{project}/{run}/file_stream".format(
base=base_url,
entity=entity,
project=project,
run=run_id)
self._client = requests.Session()
self._client.auth = ('api', api_key)
self._client.timeout = self.HTTP_TIMEOUT
self._client.headers.update({
'User-Agent': user_agent,
})
self._file_policies = {}
self._queue = queue.Queue()
self._thread = threading.Thread(target=self._thread_body)
# It seems we need to make this a daemon thread to get sync.py's atexit handler to run, which
# cleans this thread up.
self._thread.daemon = True
self._thread.start()
评论列表
文章目录