Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pycalibration
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Analyze
Contributor 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
calibration
pycalibration
Commits
c9f2f3d2
Commit
c9f2f3d2
authored
1 year ago
by
Thomas Kluyver
Browse files
Options
Downloads
Patches
Plain Diff
Use fractional seconds in timestamps from webservice
parent
fe43ab03
No related branches found
No related tags found
1 merge request
!871
Make metadata directory name match report filename
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
webservice/webservice.py
+9
-9
9 additions, 9 deletions
webservice/webservice.py
with
9 additions
and
9 deletions
webservice/webservice.py
+
9
−
9
View file @
c9f2f3d2
...
@@ -956,7 +956,7 @@ class ActionsServer:
...
@@ -956,7 +956,7 @@ class ActionsServer:
This will trigger a correction process to be launched for that run in
This will trigger a correction process to be launched for that run in
the given cycle and proposal.
the given cycle and proposal.
"""
"""
request_time
=
datetime
.
now
()
.
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
request_time
=
datetime
.
now
()
try
:
try
:
runnr
=
runnr
.
strip
(
'
r
'
)
runnr
=
runnr
.
strip
(
'
r
'
)
...
@@ -970,9 +970,9 @@ class ActionsServer:
...
@@ -970,9 +970,9 @@ class ActionsServer:
return
msg
.
encode
()
return
msg
.
encode
()
with
time_db_transaction
(
self
.
job_db
,
'
Insert request
'
):
with
time_db_transaction
(
self
.
job_db
,
'
Insert request
'
):
cur
=
self
.
job_db
.
execute
(
# 2
cur
=
self
.
job_db
.
execute
(
"
INSERT INTO requests VALUES (NULL, ?, ?, ?,
'
CORRECT
'
, ?)
"
,
"
INSERT INTO requests VALUES (NULL, ?, ?, ?,
'
CORRECT
'
, ?)
"
,
(
rid
,
proposal
,
int
(
runnr
),
request_time
)
(
rid
,
proposal
,
int
(
runnr
),
request_time
.
isoformat
()
)
)
)
req_id
=
cur
.
lastrowid
req_id
=
cur
.
lastrowid
...
@@ -1105,7 +1105,7 @@ class ActionsServer:
...
@@ -1105,7 +1105,7 @@ class ActionsServer:
with
time_db_transaction
(
self
.
job_db
,
'
Insert request
'
):
with
time_db_transaction
(
self
.
job_db
,
'
Insert request
'
):
cur
=
self
.
job_db
.
execute
(
cur
=
self
.
job_db
.
execute
(
"
INSERT INTO requests VALUES (NULL, ?, ?, ?,
'
CORRECT
'
, ?)
"
,
"
INSERT INTO requests VALUES (NULL, ?, ?, ?,
'
CORRECT
'
, ?)
"
,
(
rid
,
proposal
,
int
(
runnr
),
request_time
.
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
))
(
rid
,
proposal
,
int
(
runnr
),
request_time
.
isoformat
(
))
)
)
req_id
=
cur
.
lastrowid
req_id
=
cur
.
lastrowid
...
@@ -1170,7 +1170,7 @@ class ActionsServer:
...
@@ -1170,7 +1170,7 @@ class ActionsServer:
'
--env-cache
'
,
'
--env-cache
'
,
f
'
/gpfs/exfel/data/scratch/
{
getuser
()
}
/calib-repeat-envs
'
,
f
'
/gpfs/exfel/data/scratch/
{
getuser
()
}
/calib-repeat-envs
'
,
'
--report-to
'
,
'
--report-to
'
,
f
'
{
reports_dir
}
/
{
karabo_id
}
_RECORRECT_
{
request_time
:
%
y
%
m
%
d_
%
H
%
M
%
S
}
'
f
'
{
reports_dir
}
/
{
karabo_id
}
_RECORRECT_
{
request_time
:
%
y
%
m
%
d_
%
H
%
M
%
S
.
%
f
}
'
]
]
with
time_db_transaction
(
self
.
job_db
,
'
Insert execution
'
):
with
time_db_transaction
(
self
.
job_db
,
'
Insert execution
'
):
...
@@ -1216,7 +1216,7 @@ class ActionsServer:
...
@@ -1216,7 +1216,7 @@ class ActionsServer:
:param runnr: is the run number in integer form, i.e. without leading
:param runnr: is the run number in integer form, i.e. without leading
"
r
"
"
r
"
"""
"""
request_time
=
datetime
.
now
()
.
strftime
(
'
%Y-%m-%dT%H:%M:%S
'
)
request_time
=
datetime
.
now
()
try
:
try
:
pdus
,
karabo_das
,
wait_runs
=
ast
.
literal_eval
(
'
,
'
.
join
(
extra
))
pdus
,
karabo_das
,
wait_runs
=
ast
.
literal_eval
(
'
,
'
.
join
(
extra
))
...
@@ -1236,7 +1236,7 @@ class ActionsServer:
...
@@ -1236,7 +1236,7 @@ class ActionsServer:
with
time_db_transaction
(
self
.
job_db
,
'
Insert request
'
):
with
time_db_transaction
(
self
.
job_db
,
'
Insert request
'
):
cur
=
self
.
job_db
.
execute
(
cur
=
self
.
job_db
.
execute
(
"
INSERT INTO requests VALUES (NULL, ?, ?, ?,
'
DARK
'
, ?)
"
,
"
INSERT INTO requests VALUES (NULL, ?, ?, ?,
'
DARK
'
, ?)
"
,
(
rid
,
proposal
,
int
(
wait_runs
[
-
1
]),
request_time
)
(
rid
,
proposal
,
int
(
wait_runs
[
-
1
]),
request_time
.
isoformat
()
)
)
)
req_id
=
cur
.
lastrowid
req_id
=
cur
.
lastrowid
...
@@ -1445,9 +1445,9 @@ class ActionsServer:
...
@@ -1445,9 +1445,9 @@ class ActionsServer:
action
=
action
,
instrument
=
instrument
,
action
=
action
,
instrument
=
instrument
,
cycle
=
cycle
,
proposal
=
proposal
,
cycle
=
cycle
,
proposal
=
proposal
,
runs
=
"
_
"
.
join
([
f
"
r
{
r
}
"
for
r
in
run_nrs
]),
runs
=
"
_
"
.
join
([
f
"
r
{
r
}
"
for
r
in
run_nrs
]),
time_stamp
=
datetime
.
now
()
.
strftime
(
'
%y%m%d_%H%M%S
'
),
time_stamp
=
request_time
.
strftime
(
'
%y%m%d_%H%M%S
.%f
'
),
det_instance
=
karabo_id
,
det_instance
=
karabo_id
,
request_time
=
request_time
request_time
=
request_time
.
isoformat
(),
).
split
()
).
split
()
cmd
=
parse_config
(
cmd
,
dconfig
)
cmd
=
parse_config
(
cmd
,
dconfig
)
...
...
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