Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vospace-transfer-service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
VOSpace INAF
vospace-transfer-service
Commits
ca3e3f7a
Commit
ca3e3f7a
authored
Sep 21, 2021
by
Cristiano Urban
Browse files
Options
Downloads
Patches
Plain Diff
Minor changes.
Signed-off-by:
Cristiano Urban
<
cristiano.urban@inaf.it
>
parent
5b96412a
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
transfer_service/db_connector.py
+4
-3
4 additions, 3 deletions
transfer_service/db_connector.py
transfer_service/job_rpc_server.py
+2
-2
2 additions, 2 deletions
transfer_service/job_rpc_server.py
with
6 additions
and
5 deletions
transfer_service/db_connector.py
+
4
−
3
View file @
ca3e3f7a
...
@@ -406,7 +406,7 @@ class DbConnector(object):
...
@@ -406,7 +406,7 @@ class DbConnector(object):
finally
:
finally
:
self
.
connPool
.
putconn
(
conn
,
close
=
False
)
self
.
connPool
.
putconn
(
conn
,
close
=
False
)
def
lis
tActiveJobs
(
self
):
def
ge
tActiveJobs
(
self
):
"""
Returns some info about active jobs.
"""
"""
Returns some info about active jobs.
"""
conn
=
self
.
getConnection
()
conn
=
self
.
getConnection
()
try
:
try
:
...
@@ -420,6 +420,7 @@ class DbConnector(object):
...
@@ -420,6 +420,7 @@ class DbConnector(object):
owner_id
owner_id
FROM job
FROM job
WHERE phase NOT IN (
'
ABORTED
'
,
WHERE phase NOT IN (
'
ABORTED
'
,
'
ARCHIVED
'
,
'
COMPLETED
'
,
'
COMPLETED
'
,
'
ERROR
'
)
'
ERROR
'
)
AND
AND
...
@@ -447,12 +448,12 @@ class DbConnector(object):
...
@@ -447,12 +448,12 @@ class DbConnector(object):
finally
:
finally
:
self
.
connPool
.
putconn
(
conn
,
close
=
False
)
self
.
connPool
.
putconn
(
conn
,
close
=
False
)
def
lis
tJobsByPhase
(
self
,
phase
):
def
ge
tJobsByPhase
(
self
,
phase
):
"""
Returns some info about jobs according to the phase.
"""
"""
Returns some info about jobs according to the phase.
"""
conn
=
self
.
getConnection
()
conn
=
self
.
getConnection
()
try
:
try
:
cursor
=
conn
.
cursor
(
cursor_factory
=
RealDictCursor
)
cursor
=
conn
.
cursor
(
cursor_factory
=
RealDictCursor
)
if
phase
in
[
"
PENDING
"
,
"
QUEUED
"
,
"
EXECUTING
"
]:
if
phase
in
[
"
PENDING
"
,
"
QUEUED
"
,
"
EXECUTING
"
,
"
HELD
"
,
"
SUSPENDED
"
]:
cursor
.
execute
(
"""
cursor
.
execute
(
"""
SELECT job_id,
SELECT job_id,
job_type,
job_type,
...
...
This diff is collapsed.
Click to expand it.
transfer_service/job_rpc_server.py
+
2
−
2
View file @
ca3e3f7a
...
@@ -48,7 +48,7 @@ class JobRPCServer(RedisRPCServer):
...
@@ -48,7 +48,7 @@ class JobRPCServer(RedisRPCServer):
"
errorMsg
"
:
errorMsg
}
"
errorMsg
"
:
errorMsg
}
elif
requestBody
[
"
requestType
"
]
==
"
JOB_LIST
"
:
elif
requestBody
[
"
requestType
"
]
==
"
JOB_LIST
"
:
try
:
try
:
result
=
self
.
dbConn
.
lis
tActiveJobs
()
result
=
self
.
dbConn
.
ge
tActiveJobs
()
except
Exception
:
except
Exception
:
errorMsg
=
"
Database error.
"
errorMsg
=
"
Database error.
"
self
.
logger
.
exception
(
errorMsg
)
self
.
logger
.
exception
(
errorMsg
)
...
@@ -62,7 +62,7 @@ class JobRPCServer(RedisRPCServer):
...
@@ -62,7 +62,7 @@ class JobRPCServer(RedisRPCServer):
elif
requestBody
[
"
requestType
"
]
==
"
JOB_BY_PHASE
"
:
elif
requestBody
[
"
requestType
"
]
==
"
JOB_BY_PHASE
"
:
jobPhase
=
requestBody
[
"
jobPhase
"
]
jobPhase
=
requestBody
[
"
jobPhase
"
]
try
:
try
:
result
=
self
.
dbConn
.
lis
tJobsByPhase
(
jobPhase
)
result
=
self
.
dbConn
.
ge
tJobsByPhase
(
jobPhase
)
except
Exception
:
except
Exception
:
errorMsg
=
"
Database error.
"
errorMsg
=
"
Database error.
"
self
.
logger
.
exception
(
errorMsg
)
self
.
logger
.
exception
(
errorMsg
)
...
...
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
sign in
to comment