Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fractalis
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Fractalis
fractalis
Commits
db9df5c9
There was a problem fetching the pipeline metadata.
Commit
db9df5c9
authored
8 years ago
by
Sascha Herzinger
Browse files
Options
Downloads
Patches
Plain Diff
comply with defined API
parent
9a75888e
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fractalis/analytics/controllers.py
+4
-4
4 additions, 4 deletions
fractalis/analytics/controllers.py
gitlab-config.py
+1
-0
1 addition, 0 deletions
gitlab-config.py
with
5 additions
and
4 deletions
fractalis/analytics/controllers.py
+
4
−
4
View file @
db9df5c9
...
...
@@ -33,12 +33,12 @@ def create_job():
json
=
request
.
get_json
(
force
=
True
)
task
=
get_celery_task
(
json
[
'
task
'
])
if
task
is
None
:
return
jsonify
({
'
error
'
:
'
Task {} not found.
'
.
format
(
return
jsonify
({
'
error
_msg
'
:
'
Task {} not found.
'
.
format
(
json
[
'
task
'
])}),
400
try
:
async_result
=
task
.
delay
(
**
json
[
'
args
'
])
except
TypeError
as
e
:
return
jsonify
({
'
error
'
:
'
Invalid Arguments for task {}: {}
'
.
format
(
return
jsonify
({
'
error
_msg
'
:
'
Invalid Arguments for task {}: {}
'
.
format
(
json
[
'
task
'
],
e
)}),
400
session
[
'
tasks
'
].
append
(
async_result
.
id
)
...
...
@@ -49,7 +49,7 @@ def create_job():
def
get_job_details
(
task_id
):
task_id
=
str
(
task_id
)
if
task_id
not
in
session
[
'
tasks
'
]:
# access control
return
jsonify
({
'
error
'
:
"
No matching task found.
"
}),
404
return
jsonify
({
'
error
_msg
'
:
"
No matching task found.
"
}),
404
async_result
=
celery
.
AsyncResult
(
task_id
)
wait
=
bool
(
int
(
request
.
args
.
get
(
'
wait
'
)
or
0
))
if
wait
:
...
...
@@ -66,7 +66,7 @@ def get_job_details(task_id):
def
cancel_job
(
task_id
):
task_id
=
str
(
task_id
)
if
task_id
not
in
session
[
'
tasks
'
]:
# Access control
return
jsonify
({
'
error
'
:
"
No matching task found.
"
}),
404
return
jsonify
({
'
error
_msg
'
:
"
No matching task found.
"
}),
404
wait
=
bool
(
int
(
request
.
args
.
get
(
'
wait
'
)
or
0
))
# possibly dangerous: http://stackoverflow.com/a/29627549
celery
.
control
.
revoke
(
task_id
,
terminate
=
True
,
signal
=
'
SIGUSR1
'
,
wait
=
wait
)
...
...
This diff is collapsed.
Click to expand it.
gitlab-config.py
+
1
−
0
View file @
db9df5c9
"""
The only purpose of this file is to have a running CI test environment.
"""
REDIS_HOST
=
'
redis
'
BROKER_URL
=
'
amqp://guest:guest@rabbitmq:5672//
'
...
...
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