Skip to content

Commit

Permalink
processor: throw if we can't get repo data from db
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdulrhmnGhanem committed Sep 28, 2022
1 parent 165e418 commit 1d6b899
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions processor/src/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export function watch(repoDir, { giteaDB }: WatchOptions) {
ownerName = giteaRepo.owner_name
repoName = giteaRepo.name

if ([defaultBranch, originalUrl, repoDescription, giteaId, ownerName, repoName].includes(null)) {
throw new Error(
`Couldn't get repo data form database. giteaRepo: ${JSON.stringify(repoDescription)}`)
}

if (giteaRepo.is_empty) {
await giteaDB.waitForNonEmpty(giteaId)
}
Expand Down

0 comments on commit 1d6b899

Please sign in to comment.