@@ -3,7 +3,7 @@ import { generate, saveShards } from '@lighthouse-web3/kavach'
33import { encryptFile } from '../../encryptionNode'
44import { walk } from '../../../upload/files/node'
55import { IFileUploadedResponse } from '../../../../types'
6- import { retryFetch } from '../../../utils/util'
6+ import { fetchWithTimeout } from '../../../utils/util'
77
88export default async (
99 sourcePath : any ,
@@ -28,7 +28,7 @@ export default async (
2828 const blob = new Blob ( [ Buffer . from ( encryptedData ) ] )
2929 formData . append ( 'file' , blob , sourcePath . replace ( / ^ .* [ \\ / ] / , '' ) )
3030
31- const response = await retryFetch ( endpoint , {
31+ const response = await fetchWithTimeout ( endpoint , {
3232 method : 'POST' ,
3333 body : formData ,
3434 timeout : 7200000 ,
@@ -81,7 +81,7 @@ export default async (
8181 } )
8282 )
8383
84- const response = await retryFetch ( endpoint , {
84+ const response = await fetchWithTimeout ( endpoint , {
8585 method : 'POST' ,
8686 body : formData ,
8787 timeout : 7200000 ,
@@ -96,9 +96,7 @@ export default async (
9696 }
9797
9898 const responseText = await response . text ( )
99- const jsondata = JSON . parse (
100- `[${ responseText . slice ( 0 , - 1 ) } ]` . split ( '\n' ) . join ( ',' )
101- ) as IFileUploadedResponse [ ]
99+ const jsondata = JSON . parse ( responseText ) as IFileUploadedResponse [ ]
102100
103101 const savedKey = await Promise . all (
104102 jsondata . map ( async ( data ) => {
0 commit comments