Skip to content

Commit

Permalink
Small fixes to the ingests script #138
Browse files Browse the repository at this point in the history
  • Loading branch information
TheoWolf committed Oct 5, 2020
1 parent b3b9148 commit cf8fafb
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions ingests/20201004-lego.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,7 @@ async function main () {
return false
}

if (!newUser.authServerId) {
return false
}
if (!newUser.authServerId) return false

const userDTO: UserDTO = new UserDTO(newUser)
try {
Expand All @@ -75,9 +73,6 @@ async function main () {

console.log(`Added ${_.sum(userSuccesses)} users`)

// Next projects
// TODO ingest projects

const pamSuccesses = await pMap(ingestData, async (pam) => {
// We only consider the first listed owner
const createdById = _.get(pam, 'owners')[0].id
Expand Down Expand Up @@ -168,15 +163,15 @@ async function main () {
}
})

console.log(`Added ${_.sum(filesSuccesses)} files in folder ${folderId}`)
console.log(`Added ${filesSuccesses.length} files in folder ${folderId}`)
return true
})

console.log(`Added ${_.sum(foldersSuccesses)} folders in pam ${pamId}`)
return 1
console.log(`Added ${foldersSuccesses.length} folders in pam ${pamId}`)
return true
})

console.log(`Added ${_.sum(pamSuccesses)} pams`)
console.log(`Added ${pamSuccesses.length} pams`)
await knex.destroy()
await app.close()
}
Expand Down

0 comments on commit cf8fafb

Please sign in to comment.