Explorar el Código

Handle rangeHashes

GitOrigin-RevId: 9b9a67d8e45f17e948d003aed33cef6128a25744
Andrew Rumble hace 1 año
padre
commit
903277c222
Se han modificado 1 ficheros con 10 adiciones y 2 borrados
  1. 10 2
      services/history-v1/storage/lib/backupArchiver.mjs

+ 10 - 2
services/history-v1/storage/lib/backupArchiver.mjs

@@ -49,10 +49,18 @@ class BackupBlobStore {
    * Required for BlobStore interface - not supported.
    *
    * @template T
+   * @param {string} hash
    * @return {Promise<T>}
    */
-  async getObject() {
-    throw new Error('Not implemented')
+  async getObject(hash) {
+    try {
+      const stream = await this.getStream(hash)
+      const buffer = await streams.readStreamToBuffer(stream)
+      return JSON.parse(buffer.toString())
+    } catch (err) {
+      logger.warn({ err, hash }, 'Failed to fetch chunk blob')
+      throw err
+    }
   }
 
   /**