Kaynağa Gözat

Update storage node api class

Leszek Wiesner 3 yıl önce
ebeveyn
işleme
2d1ea421f0

+ 2 - 7
distributor-node/src/services/networking/storage-node/api.ts

@@ -20,14 +20,9 @@ export class StorageNodeApi {
   }
 
   public async isObjectAvailable(contentHash: string): Promise<boolean> {
-    const options: AxiosRequestConfig = {
-      headers: {
-        Range: 'bytes=0-0',
-      },
-    }
     this.logger.debug('Checking object availibility', { contentHash })
     try {
-      await this.publicApi.publicApiFiles(contentHash, options)
+      await this.publicApi.publicApiGetFileHeaders(contentHash)
       this.logger.debug('Data object available', { contentHash })
       return true
     } catch (err) {
@@ -48,6 +43,6 @@ export class StorageNodeApi {
     if (startAt) {
       options.headers.Range = `bytes=${startAt}-`
     }
-    return this.publicApi.publicApiFiles(contentHash, options)
+    return this.publicApi.publicApiGetFile(contentHash, options)
   }
 }