Additional debugging for putContentsAsync freeze

This commit is contained in:
Dan Stillman 2013-11-17 23:34:19 -05:00
parent f2034eec29
commit 98b7ab78d5
2 changed files with 4 additions and 1 deletions

View File

@ -248,6 +248,7 @@ Zotero.File = new function(){
if (typeof data == 'string'
&& Zotero.platformMajorVersion >= 19
&& (!charset || charset.toLowerCase() == 'utf-8')) {
Zotero.debug('Saving contents using OS.File');
let encoder = new TextEncoder();
let array = encoder.encode(data);
return Q(OS.File.writeAtomic(
@ -258,6 +259,7 @@ Zotero.File = new function(){
}
))
.catch(function (e) {
Zotero.debug(e); // TEMP
if (e instanceof OS.File.Error) {
Zotero.debug(e);
Zotero.debug(e.toString());
@ -267,6 +269,7 @@ Zotero.File = new function(){
});
}
else {
Zotero.debug('Saving contents using asyncCopy');
// Create a stream for async stream copying
if(!(data instanceof Components.interfaces.nsIInputStream)) {
var converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"].

View File

@ -929,7 +929,7 @@ Zotero.Fulltext = new function(){
cacheFile = self.getItemCacheFile(itemID);
Zotero.debug("Writing full-text content to " + cacheFile.path);
return Zotero.File.putContentsAsync(cacheFile, data.text, "UTF-8");
return Zotero.File.putContentsAsync(cacheFile, data.text);
})
.then(function () {
Zotero.Fulltext.indexString(