Initialize VLC getters and metrics, fix some bugs in infra logic, needs to be refactored later on

This commit is contained in:
Timothyxxx
2024-01-04 17:05:17 +08:00
parent 03e99a68fb
commit ab71ebb2ba
7 changed files with 101 additions and 32 deletions

View File

@@ -3,6 +3,7 @@ from typing import Dict
import os
import requests
def get_cloud_file(env, config: Dict[str, str]) -> str:
"""
Config:
@@ -25,6 +26,7 @@ def get_cloud_file(env, config: Dict[str, str]) -> str:
return _path
def get_vm_file(env, config: Dict[str, str]) -> str:
"""
Config:
@@ -33,12 +35,9 @@ def get_vm_file(env, config: Dict[str, str]) -> str:
"""
_path = os.path.join(env.cache_dir, config["dest"])
if os.path.exists(_path):
return _path
file = env.controller.get_file(config["path"])
with open(_path, "wb") as f:
f.write(file)
return _path