Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
f3a37978
Commit
f3a37978
authored
Aug 25, 2020
by
blitzmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fail the convert task if the email subtask fails
parent
5ec1283b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
convert.py
cps/tasks/convert.py
+6
-2
No files found.
cps/tasks/convert.py
View file @
f3a37978
...
@@ -8,7 +8,7 @@ from shutil import copyfile
...
@@ -8,7 +8,7 @@ from shutil import copyfile
from
sqlalchemy.exc
import
SQLAlchemyError
from
sqlalchemy.exc
import
SQLAlchemyError
from
cps.services.worker
import
CalibreTask
from
cps.services.worker
import
CalibreTask
,
STAT_FINISH_SUCCESS
from
cps
import
calibre_db
,
db
from
cps
import
calibre_db
,
db
from
cps
import
logger
,
config
from
cps
import
logger
,
config
from
cps.subproc_wrapper
import
process_open
from
cps.subproc_wrapper
import
process_open
...
@@ -43,7 +43,11 @@ class TaskConvert(CalibreTask):
...
@@ -43,7 +43,11 @@ class TaskConvert(CalibreTask):
task
=
TaskEmail
(
self
.
settings
[
'subject'
],
self
.
results
[
"path"
],
task
=
TaskEmail
(
self
.
settings
[
'subject'
],
self
.
results
[
"path"
],
filename
,
self
.
settings
,
self
.
kindle_mail
,
filename
,
self
.
settings
,
self
.
kindle_mail
,
self
.
settings
[
'subject'
],
self
.
settings
[
'body'
],
internal
=
True
)
self
.
settings
[
'subject'
],
self
.
settings
[
'body'
],
internal
=
True
)
task
.
start
()
task
.
start
(
worker_thread
)
# even though the convert task might be finished, if this task fails, fail the whole thing
if
task
.
stat
!=
STAT_FINISH_SUCCESS
:
raise
Exception
(
task
.
error
)
except
Exception
as
e
:
except
Exception
as
e
:
return
self
.
_handleError
(
str
(
e
))
return
self
.
_handleError
(
str
(
e
))
...
...
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