- fix old problems
This commit is contained in:
parent
aa45c87846
commit
2d8d95f3c3
|
|
@ -38,7 +38,7 @@ BackendServer : utils_qualtest.QualtestBackend = None
|
|||
REFERENCE_AUDIO = "/dev/shm/reference.wav"
|
||||
|
||||
# Loaded refernce audio (from backend)
|
||||
LOADED_AUDIO = "/dev/shm/loaded_audio.wav"
|
||||
LOADED_AUDIO = Path("/dev/shm/loaded_audio.wav")
|
||||
|
||||
# Script to exec after mobile call answering
|
||||
EXEC_SCRIPT = None
|
||||
|
|
@ -278,12 +278,15 @@ def run_caller_task(t):
|
|||
task_name = t['name'].strip()
|
||||
|
||||
# Load reference audio
|
||||
if LOADED_AUDIO.exists():
|
||||
os.remove(LOADED_AUDIO)
|
||||
|
||||
if not BackendServer.load_audio(t["audio_id"], LOADED_AUDIO):
|
||||
utils.log_error('No audio is available, exiting.')
|
||||
sys.exit(EXIT_ERROR)
|
||||
|
||||
# Use loaded audio as reference
|
||||
REFERENCE_AUDIO = LOADED_AUDIO
|
||||
REFERENCE_AUDIO = str(LOADED_AUDIO)
|
||||
|
||||
CURRENT_TASK = task_name
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ import requests
|
|||
|
||||
from socket import timeout
|
||||
from crontab import CronTab
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
start_system_time = time.time()
|
||||
start_monotonic_time = time.monotonic()
|
||||
|
|
@ -171,7 +171,7 @@ class QualtestBackend:
|
|||
|
||||
def upload_report(self, report, files) -> str:
|
||||
# UUID string as result
|
||||
result = None
|
||||
result = None
|
||||
|
||||
# Log about upload attempt
|
||||
utils.log_verbose(f"Uploading to {self.address} files {files} and report: {json.dumps(report, indent=4)}")
|
||||
|
|
@ -303,7 +303,7 @@ class QualtestBackend:
|
|||
return dict()
|
||||
|
||||
|
||||
def load_audio(self, audio_id: int, output_path: str):
|
||||
def load_audio(self, audio_id: int, output_path: Path):
|
||||
utils.log(f'Loading audio with ID: {audio_id}')
|
||||
try:
|
||||
# Build query for both V1 & V2 API
|
||||
|
|
|
|||
Loading…
Reference in New Issue