From 601464083b6f52f030e1304203b7e430e3d3c82f Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sun, 28 Jun 2020 13:44:21 +0200 Subject: [PATCH 1/2] Fix for task wrap around --- cps/worker.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cps/worker.py b/cps/worker.py index 615d4183..6d17f470 100644 --- a/cps/worker.py +++ b/cps/worker.py @@ -206,12 +206,12 @@ class WorkerThread(threading.Thread): self.doLock.acquire() if self.current != self.last: index = self.current + log.info(index) + log.info(len(self.queue)) self.doLock.release() if self.queue[index]['taskType'] == TASK_EMAIL: self._send_raw_email() - if self.queue[index]['taskType'] == TASK_CONVERT: - self._convert_any_format() - if self.queue[index]['taskType'] == TASK_CONVERT_ANY: + elif self.queue[index]['taskType'] in (TASK_CONVERT, TASK_CONVERT_ANY): self._convert_any_format() # TASK_UPLOAD is handled implicitly self.doLock.acquire() @@ -274,7 +274,8 @@ class WorkerThread(threading.Thread): self.add_email(self.queue[index]['settings']['subject'], self.queue[index]['path'], filename, self.queue[index]['settings'], self.queue[index]['kindle'], self.UIqueue[index]['user'], self.queue[index]['title'], - self.queue[index]['settings']['body']) + self.queue[index]['settings']['body'], internal=True) + def _convert_ebook_format(self): error_message = None @@ -449,11 +450,13 @@ class WorkerThread(threading.Thread): self.doLock.release() def add_email(self, subject, filepath, attachment, settings, recipient, user_name, taskMessage, - text): + text, internal=False): # if more than 20 entries in the list, clean the list self.doLock.acquire() if self.last >= 20: self._delete_completed_tasks() + if internal: + self.current-= 1 # progress, runtime, and status = 0 self.id += 1 self.queue.append({'subject':subject, 'attachment':attachment, 'filepath':filepath, From a14192b7e0a65dcde6d5600de979358edb1f2653 Mon Sep 17 00:00:00 2001 From: OzzieIsaacs Date: Sun, 28 Jun 2020 22:31:18 +0200 Subject: [PATCH 2/2] Updated testresults --- test/Calibre-Web TestSummary.html | 919 +++++++++++++++++------------- 1 file changed, 510 insertions(+), 409 deletions(-) diff --git a/test/Calibre-Web TestSummary.html b/test/Calibre-Web TestSummary.html index 60acb23d..43913dbe 100755 --- a/test/Calibre-Web TestSummary.html +++ b/test/Calibre-Web TestSummary.html @@ -36,17 +36,17 @@
-

Start Time: 2020-06-02 21:06:42

+

Start Time: 2020-06-28 20:44:31

-

Stop Time: 2020-06-02 22:07:54

+

Stop Time: 2020-06-28 21:48:11

-

Duration: 51:46 min

+

Duration: 53:53 min

@@ -99,7 +99,7 @@ - test_anonymous.test_anonymous + test_anonymous.testAnonymous 13 13 0 @@ -231,7 +231,7 @@ - test_cli.test_cli + test_cli.testCli 7 6 0 @@ -326,38 +326,88 @@ - test_ebook_convert.test_ebook_convert + test_cover_edit_books.testCoverEditBooks + 1 + 0 + 1 + 0 + 0 + + Detail + + + + + + + +
test_upload_jpg
+ + +
+ FAIL +
+ + + + + + + + + + + test_delete_database.TestDeleteDatabase + 1 + 1 + 0 + 0 + 0 + + Detail + + + + + + + +
test_delete_books_in_database
+ + PASS + + + + + + + test_ebook_convert.TestEbookConvert 11 11 0 0 0 - Detail + Detail - - -
test_SSL_smtp_setup_error
- - PASS - - - - - - -
test_STARTTLS_smtp_setup_error
- - PASS - - - - - +
test_convert_deactivate
@@ -366,7 +416,7 @@ - +
test_convert_email
@@ -375,7 +425,7 @@ - +
test_convert_failed_and_email
@@ -384,7 +434,7 @@ - +
test_convert_only
@@ -393,7 +443,7 @@ - +
test_convert_parameter
@@ -402,7 +452,7 @@ - +
test_convert_wrong_excecutable
@@ -411,7 +461,7 @@ - +
test_email_failed
@@ -420,7 +470,7 @@ - +
test_email_only
@@ -429,147 +479,9 @@ - - -
test_kindle_send_not_configured
- - PASS - - - - - - - test_edit_additional_books.test_edit_additional_books - 3 - 3 - 0 - 0 - 0 - - Detail - - - - - - - -
test_delete_book
- - PASS - - - - - - -
test_upload_metadata_cbt
- - PASS - - - - - - -
test_upload_metadate_cbr
- - PASS - - - - - - - test_edit_books.test_edit_books - 33 - 30 - 1 - 0 - 2 - - Detail - - - - - - - -
test_download_book
- - PASS - - - - - - -
test_edit_author
- - PASS - - - - - - -
test_edit_category
- - PASS - - - - - - -
test_edit_comments
- - PASS - - - - - - -
test_edit_custom_bool
- - PASS - - - - - - -
test_edit_custom_categories
- - PASS - - - - - - -
test_edit_custom_float
- - PASS - - - - - - -
test_edit_custom_int
- - PASS - - - - -
test_edit_custom_rating
+
test_kindle_send_not_configured
PASS @@ -578,7 +490,7 @@ -
test_edit_custom_single_select
+
test_ssl_smtp_setup_error
PASS @@ -586,6 +498,180 @@ + +
test_starttls_smtp_setup_error
+ + PASS + + + + + + + test_edit_additional_books.TestEditAdditionalBooks + 5 + 5 + 0 + 0 + 0 + + Detail + + + + + + + +
test_delete_book
+ + PASS + + + + + + +
test_upload_metadata_cbt
+ + PASS + + + + + + +
test_upload_metadate_cbr
+ + PASS + + + + + + +
test_writeonly_database
+ + PASS + + + + + + +
test_writeonly_path
+ + PASS + + + + + + + test_edit_books.TestEditBooks + 33 + 30 + 1 + 0 + 2 + + Detail + + + + + + + +
test_download_book
+ + PASS + + + + + + +
test_edit_author
+ + PASS + + + + + + +
test_edit_category
+ + PASS + + + + + + +
test_edit_comments
+ + PASS + + + + + + +
test_edit_custom_bool
+ + PASS + + + + + + +
test_edit_custom_categories
+ + PASS + + + + + + +
test_edit_custom_float
+ + PASS + + + + + + +
test_edit_custom_int
+ + PASS + + + + + + +
test_edit_custom_rating
+ + PASS + + + + + + +
test_edit_custom_single_select
+ + PASS + + + + +
test_edit_custom_text
@@ -594,7 +680,7 @@ - +
test_edit_language
@@ -603,7 +689,7 @@ - +
test_edit_publisher
@@ -612,19 +698,19 @@ - +
test_edit_publishing_date
- SKIP + SKIP
-