Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
E
esi-table-data
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
esi-data-scrapping
esi-table-data
Commits
bcdbee56
Commit
bcdbee56
authored
Jun 22, 2017
by
Vasyl Bodnaruk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add functional for restart job
parent
b6ddb481
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
service.py
esi/scraper/service.py
+0
-1
views.py
esi/scraper/views.py
+2
-0
No files found.
esi/scraper/service.py
View file @
bcdbee56
...
@@ -60,7 +60,6 @@ class Service:
...
@@ -60,7 +60,6 @@ class Service:
job
.
save
()
job
.
save
()
return
job
.
json
()
return
job
.
json
()
def
get_log
(
self
,
job
):
def
get_log
(
self
,
job
):
job
=
Job
.
objects
.
get
(
pk
=
job
)
job
=
Job
.
objects
.
get
(
pk
=
job
)
url
=
'http://127.0.0.1:6800/logs/exa/mhn/{}.log'
.
format
(
job
.
job_uuid
)
url
=
'http://127.0.0.1:6800/logs/exa/mhn/{}.log'
.
format
(
job
.
job_uuid
)
...
...
esi/scraper/views.py
View file @
bcdbee56
...
@@ -51,6 +51,8 @@ class JobListView(ListView):
...
@@ -51,6 +51,8 @@ class JobListView(ListView):
return
JsonResponse
(
self
.
service
.
activate_job
(
job_id
))
return
JsonResponse
(
self
.
service
.
activate_job
(
job_id
))
if
action
==
'new'
:
if
action
==
'new'
:
return
HttpResponseRedirect
(
reverse
(
'new_job'
))
return
HttpResponseRedirect
(
reverse
(
'new_job'
))
if
action
==
'restart'
:
return
JsonResponse
(
self
.
service
.
restart_job
(
job_id
))
if
action
==
'log'
:
if
action
==
'log'
:
log
=
self
.
service
.
get_log
(
job_id
)
log
=
self
.
service
.
get_log
(
job_id
)
return
HttpResponse
(
log
,
content_type
=
'text/plain'
)
return
HttpResponse
(
log
,
content_type
=
'text/plain'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment