diff --git a/worker/search.js b/worker/search.js index 7e91c10f..ebbde5bf 100644 --- a/worker/search.js +++ b/worker/search.js @@ -117,6 +117,11 @@ export async function indexItem ({ data: { id, updatedAt }, apollo, models }) { }` }) + if (!item) { + console.log('item not found', id) + return + } + // 2. index it with external version based on updatedAt await _indexItem(item, { models, updatedAt }) } diff --git a/worker/weeklyPosts.js b/worker/weeklyPosts.js index 552a837f..3310254c 100644 --- a/worker/weeklyPosts.js +++ b/worker/weeklyPosts.js @@ -31,7 +31,9 @@ export async function payWeeklyPostBounty ({ data: { id }, models, apollo, lnd } bounty bountyPaidTo comments(sort: "top") { - id + comments { + id + } } } }`, @@ -44,7 +46,7 @@ export async function payWeeklyPostBounty ({ data: { id }, models, apollo, lnd } throw new Error('Bounty already paid') } - const winner = item.comments[0] + const winner = item.comments.comments[0] if (!winner) { throw new Error('No winner')