Skip to content

Commit

Permalink
tweak log parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Nov 2, 2023
1 parent c9532e0 commit 5477f20
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/pds/src/migrate-script/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,13 @@ const doImport = async (
)

for await (const log of importRes.data) {
const lines = log.split('\n')
for (const line of lines) {
if (line.indexOf('failed to import blob') > 0) {
const cid = line.split(':')[1].trim()
await logFailedBlob(db, did, cid)
if (typeof log === 'string') {
const lines = log.split('\n')
for (const line of lines) {
if (line.indexOf('failed to import blob') > 0) {
const cid = line.split(':')[1].trim()
await logFailedBlob(db, did, cid)
}
}
}
console.log(`import update for ${did}: `, log.toString())
Expand Down

0 comments on commit 5477f20

Please sign in to comment.