diff options
author | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-10-17 15:04:30 +0530 |
---|---|---|
committer | usodhi <61431818+usodhi@users.noreply.github.com> | 2020-10-17 15:04:30 +0530 |
commit | cf1d27d35864915ea67050297e1c888aa0f81709 (patch) | |
tree | a408d7c0570578531fa21c1add6b2d6c2baf6235 /src/client/DocServer.ts | |
parent | 9b82c151533ec336155d20b9e1641dc2d7a5cf81 (diff) | |
parent | 5816840af60f97a34318a52a5276482cab392496 (diff) |
Merge branch 'master' of https://github.com/browngraphicslab/Dash-Web into restored_server_monitor
Diffstat (limited to 'src/client/DocServer.ts')
-rw-r--r-- | src/client/DocServer.ts | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/client/DocServer.ts b/src/client/DocServer.ts index 00f9877c3..1d7497cf8 100644 --- a/src/client/DocServer.ts +++ b/src/client/DocServer.ts @@ -28,13 +28,13 @@ import * as rp from 'request-promise'; export namespace DocServer { let _cache: { [id: string]: RefField | Promise<Opt<RefField>> } = {}; - export function PRINT_CACHE() { + export function UPDATE_SERVER_CACHE(print: boolean = false) { const strings: string[] = []; Array.from(Object.keys(_cache)).forEach(key => { const doc = _cache[key]; if (doc instanceof Doc) strings.push(StrCast(doc.author) + " " + StrCast(doc.title) + " " + StrCast(Doc.GetT(doc, "title", "string", true))); }); - strings.sort().forEach((str, i) => console.log(i.toString() + " " + str)); + print && strings.sort().forEach((str, i) => console.log(i.toString() + " " + str)); rp.post(Utils.prepend("/setCacheDocumentIds"), { body: { cacheDocumentIds: Array.from(Object.keys(_cache)).join(";"), @@ -348,7 +348,6 @@ export namespace DocServer { } if (requestedIds.length) { - // 2) synchronously, we emit a single callback to the server requesting the serialized (i.e. represented by a string) // fields for the given ids. This returns a promise, which, when resolved, indicates that all the JSON serialized versions of // the fields have been returned from the server |