Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/PhieF/CarnetElectron.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhie <phie@phie.ovh>2020-10-18 14:23:41 +0300
committerPhie <phie@phie.ovh>2020-10-18 14:23:53 +0300
commit9b2e9e8c1849f8a3532ec457b162ae99f935eb4c (patch)
tree107b39c3961abf67c5f570973001f732ed30ebfc
parent76b8a259c610848bd36cd536d48133a47f838591 (diff)
retry when extraction fails
-rw-r--r--reader/reader.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/reader/reader.js b/reader/reader.js
index b875bb1..48931a6 100644
--- a/reader/reader.js
+++ b/reader/reader.js
@@ -279,9 +279,25 @@ Writer.prototype.extractNote = function (callback) {
}
console.log(data)
writer.saveID = data.id;
- RequestBuilder.sRequestBuilder.get("/note/extract?path=" + encodeURIComponent(writer.note.path) + "&id=" + data.id, function (error, data) {
+ var onExtracted = function () {
writer.refreshKeywords()
writer.refreshMedia();
+ }
+ RequestBuilder.sRequestBuilder.get("/note/extract?path=" + encodeURIComponent(writer.note.path) + "&id=" + data.id, function (error, data2) {
+ if (error) {
+ console.log("extraction failed...")
+ RequestBuilder.sRequestBuilder.get("/note/extract?path=" + encodeURIComponent(writer.note.path) + "&id=" + data.id, function (error, data2) {
+ if (error) {
+ writer.displaySnack({
+ message: $.i18n("error_save"),
+ timeout: 60000 * 300,
+ })
+ writer.setDoNotEdit(true)
+ } else
+ onExtracted()
+ })
+ } else
+ onExtracted()
})
writer.fillWriter(data.html)
if (data.metadata == null) {