You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constJSON_READ_LENGTH=512*1024;// get content length use first passletdataCount=0;try{constreadStream=createReadStream(getWikiBinaryTiddlersListCachePath(workspace),{length: JSON_READ_LENGTH});readStream.on('progress',(progress: number)=>{setProgress.setReadListProgress(progress);});constcountBinaryTiddlerFieldsStream=chain([readStream,StreamArray.withParser(),]);letlastData: ISkinnyTiddlersJSONBatch[number]|undefined;countBinaryTiddlerFieldsStream.on('data',(data: ISkinnyTiddlersJSONBatch[number])=>{lastData=data;});awaitnewPromise<void>((resolve,reject)=>{countBinaryTiddlerFieldsStream.on('end',()=>{constlastIndex=lastData?.key;if(lastIndex===undefined){reject(newError('loadBinaryTiddlersAsFilesFromServer() Failed to count task, no data'));}else{dataCount=lastIndex+1;resolve();}});countBinaryTiddlerFieldsStream.on('error',(error)=>{reject(error);});});}catch(error){thrownewError(`loadBinaryTiddlersAsFilesFromServer() Failed to read tiddler text store, ${(errorasError).message}`);}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
My current solution is go through the array
I believe
part will waste many performance, is there a better way?
Beta Was this translation helpful? Give feedback.
All reactions