|
@@ -24,6 +24,7 @@ const logger = require('@overleaf/logger')
|
|
|
|
|
|
|
|
/** @import { Readable } from 'stream' */
|
|
/** @import { Readable } from 'stream' */
|
|
|
|
|
|
|
|
|
|
+/** @type {Map<string, { blob: core.Blob, demoted: boolean}>} */
|
|
|
const GLOBAL_BLOBS = new Map()
|
|
const GLOBAL_BLOBS = new Map()
|
|
|
|
|
|
|
|
function makeGlobalKey(hash) {
|
|
function makeGlobalKey(hash) {
|
|
@@ -343,6 +344,11 @@ class BlobStore {
|
|
|
return blob
|
|
return blob
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {Array<string>} hashes
|
|
|
|
|
+ * @return {Promise<*[]>}
|
|
|
|
|
+ */
|
|
|
async getBlobs(hashes) {
|
|
async getBlobs(hashes) {
|
|
|
assert.array(hashes, 'bad hashes')
|
|
assert.array(hashes, 'bad hashes')
|
|
|
const nonGlobalHashes = []
|
|
const nonGlobalHashes = []
|
|
@@ -427,6 +433,7 @@ module.exports = {
|
|
|
getProjectBlobsBatch,
|
|
getProjectBlobsBatch,
|
|
|
loadGlobalBlobs,
|
|
loadGlobalBlobs,
|
|
|
makeProjectKey,
|
|
makeProjectKey,
|
|
|
|
|
+ makeGlobalKey,
|
|
|
makeBlobForFile,
|
|
makeBlobForFile,
|
|
|
getStringLengthOfFile,
|
|
getStringLengthOfFile,
|
|
|
GLOBAL_BLOBS,
|
|
GLOBAL_BLOBS,
|