Skip to content
Snippets Groups Projects
Commit 501eed61 authored by Emanuele Laface's avatar Emanuele Laface
Browse files

Another fix tentative

parent 58b1c77f
No related branches found
Tags 2.1.3
No related merge requests found
Pipeline #82774 passed
...@@ -23,12 +23,12 @@ executor = ThreadPoolExecutor(max_workers=1000) ...@@ -23,12 +23,12 @@ executor = ThreadPoolExecutor(max_workers=1000)
@app.get("/-/health") @app.get("/-/health")
async def heath(): def heath():
return PlainTextResponse("OK") return PlainTextResponse("OK")
@app.get("/api/v1/caget/{pvlist}") @app.get("/api/v1/caget/{pvlist}")
async def get_pv(pvlist: str): def get_pv(pvlist: str):
pvnames = pvlist.split(",") pvnames = pvlist.split(",")
pvs = [epics.get_pv(pvname, auto_monitor=True) for pvname in pvnames] pvs = [epics.get_pv(pvname, auto_monitor=True) for pvname in pvnames]
time.sleep(1) time.sleep(1)
...@@ -45,7 +45,7 @@ async def get_pv(pvlist: str): ...@@ -45,7 +45,7 @@ async def get_pv(pvlist: str):
@app.get("/api/v1/archiver/{pv}") @app.get("/api/v1/archiver/{pv}")
async def check_archiver(pv: str): def check_archiver(pv: str):
return archiver.get_pv_status(pv=pv)[0] return archiver.get_pv_status(pv=pv)[0]
...@@ -102,7 +102,7 @@ def get_archiver(pv: str, start_time: str, end_time: str, samples: int, output: ...@@ -102,7 +102,7 @@ def get_archiver(pv: str, start_time: str, end_time: str, samples: int, output:
@app.get("/api/v1/archiver/{pvlist}/{start_time}/{end_time}/{samples}/{output}") @app.get("/api/v1/archiver/{pvlist}/{start_time}/{end_time}/{samples}/{output}")
async def get_archiver_from_interval( def get_archiver_from_interval(
pvlist: str, start_time: str, end_time: str, samples: int, output: str pvlist: str, start_time: str, end_time: str, samples: int, output: str
): ):
tasks = {} tasks = {}
...@@ -117,7 +117,7 @@ async def get_archiver_from_interval( ...@@ -117,7 +117,7 @@ async def get_archiver_from_interval(
@app.get("/api/v1/archiver/{pvlist}/{seconds}/{samples}/{output}") @app.get("/api/v1/archiver/{pvlist}/{seconds}/{samples}/{output}")
async def get_archiver_from_secs(pvlist: str, seconds: int, samples: int, output: str): def get_archiver_from_secs(pvlist: str, seconds: int, samples: int, output: str):
try: try:
start_time = ( start_time = (
datetime.datetime.now() + datetime.timedelta(seconds=-seconds) datetime.datetime.now() + datetime.timedelta(seconds=-seconds)
...@@ -138,7 +138,7 @@ async def get_archiver_from_secs(pvlist: str, seconds: int, samples: int, output ...@@ -138,7 +138,7 @@ async def get_archiver_from_secs(pvlist: str, seconds: int, samples: int, output
@app.get("/api/v1/channelfinder/{searchlist}/{output}") @app.get("/api/v1/channelfinder/{searchlist}/{output}")
async def search_cf(searchlist: str, output: str): def search_cf(searchlist: str, output: str):
wordlist = searchlist.split(",") wordlist = searchlist.split(",")
if len(wordlist) <= 1 and len(wordlist[0]) < 2: if len(wordlist) <= 1 and len(wordlist[0]) < 2:
return "Too few worlds or first word shorter than three chars" return "Too few worlds or first word shorter than three chars"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment