diff --git a/src/merkle/tonsutils.ts b/src/merkle/tonsutils.ts index 89427da..180c77c 100644 --- a/src/merkle/tonsutils.ts +++ b/src/merkle/tonsutils.ts @@ -76,6 +76,12 @@ export async function addTonBag({ files, donwload_all, }), + }).then((res: Response) => { + if (res.status == 200) { + return res.json() + } else { + throw new Error(`Call storage api failed: ${res.status}`) + } }); } diff --git a/src/service/storage.ts b/src/service/storage.ts index b8c4372..b6e1d23 100644 --- a/src/service/storage.ts +++ b/src/service/storage.ts @@ -38,7 +38,9 @@ export async function downloadTorrentHeaders() { if (result) { continue; } - await addTonBag(torrentHash); + await addTonBag({ + bag_id: torrentHash, + }); } catch (e) { logger.error(`Failed to download meta bag ${torrentHash}: ${e.message}`); const retryTimes = task.download_header_retry_times + 1;