@illuminis/comprism 2.7.0 → 2.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -68,7 +68,23 @@ function headers(opts, token) {
|
|
|
68
68
|
return h;
|
|
69
69
|
}
|
|
70
70
|
/** The folders the person connected on this computer, from the server. */
|
|
71
|
+
// A job asks for dozens of files in a row; the folder list is read once for a
|
|
72
|
+
// few seconds rather than once per order.
|
|
73
|
+
const FOLDERS_FOR_MS = 30_000;
|
|
74
|
+
let folderMemo = null;
|
|
71
75
|
async function connectedFolders(opts) {
|
|
76
|
+
const key = opts.baseUrl;
|
|
77
|
+
if (folderMemo && folderMemo.key === key && Date.now() - folderMemo.at < FOLDERS_FOR_MS)
|
|
78
|
+
return folderMemo.folders;
|
|
79
|
+
const folders = readConnectedFolders(opts);
|
|
80
|
+
folderMemo = { key, at: Date.now(), folders };
|
|
81
|
+
// A failure or an empty answer is never kept, so the next order asks again.
|
|
82
|
+
void folders.then((f) => { if (f.length === 0 && folderMemo?.folders === folders)
|
|
83
|
+
folderMemo = null; }, () => { if (folderMemo?.folders === folders)
|
|
84
|
+
folderMemo = null; });
|
|
85
|
+
return folders;
|
|
86
|
+
}
|
|
87
|
+
async function readConnectedFolders(opts) {
|
|
72
88
|
const token = await opts.token();
|
|
73
89
|
if (!token)
|
|
74
90
|
return [];
|
package/out/server.generated.js
CHANGED
|
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.BUILD_COMMIT = exports.HOME_SERVER = void 0;
|
|
4
4
|
// Written by the build. Do not edit.
|
|
5
5
|
exports.HOME_SERVER = "https://completionprism.illuminis.ai";
|
|
6
|
-
exports.BUILD_COMMIT = "
|
|
6
|
+
exports.BUILD_COMMIT = "067fda669c574245fe5bbf2ecd59278872d30ae3";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@illuminis/comprism",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.1",
|
|
4
4
|
"description": "CompletionPrism in your terminal. A thin shell: what you type goes to CompletionPrism's front door, and what it answers comes back.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"private": false,
|