Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ess-public-screens
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ics-software
ess-public-screens
Commits
501eed61
Commit
501eed61
authored
3 years ago
by
Emanuele Laface
Browse files
Options
Downloads
Patches
Plain Diff
Another fix tentative
parent
58b1c77f
No related branches found
Branches containing commit
Tags
2.1.3
Tags containing commit
No related merge requests found
Pipeline
#82774
passed
3 years ago
Stage: check
Stage: build
Stage: release
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
PythonServer/pos-python-server.py
+6
-6
6 additions, 6 deletions
PythonServer/pos-python-server.py
with
6 additions
and
6 deletions
PythonServer/pos-python-server.py
+
6
−
6
View file @
501eed61
...
@@ -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
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment