Skip to content

Commit

Permalink
fix: 🐛 fix typings
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Ruck committed Dec 10, 2023
1 parent a221b88 commit e73eb3a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion infra/Dockerfile.service
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ RUN adduser --system --uid 1001 runuser
COPY --from=installer /app .

# Create data directory and set permissions
RUN mkdir $SERVICE_PATH/data
RUN mkdir -p $SERVICE_PATH/data
RUN chown runuser:nodejs $SERVICE_PATH/data

USER runuser
Expand Down
25 changes: 13 additions & 12 deletions services/cron-jobs/import-named-polls/src/crawler/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ router.addDefaultHandler(({ log }) => {
router.addHandler(CRAWLER_LABELS.LIST, async ({ $, request, crawler }) => {
console.log('List', request.url);
const polls = $('.col-xs-12.bt-slide:not(.bt-slide-error)');
polls.each(async (i, poll) => {
polls.each((i, poll): boolean | void => {
const element = $(poll);

const urlElement = $(element.find('a'));
Expand Down Expand Up @@ -91,17 +91,18 @@ router.addHandler(CRAWLER_LABELS.LIST, async ({ $, request, crawler }) => {
},
};

const existingNamedPoll = await NamedPollModel.exists({ webId: id });
if (!existingNamedPoll) {
console.log('Poll Details', url);
await crawler.addRequests([
{
url,
label: CRAWLER_LABELS.POLL,
userData,
},
]);
}
NamedPollModel.exists({ webId: id }).then((exists) => {
if (!exists) {
console.log('Poll Details', url);
crawler.addRequests([
{
url,
label: CRAWLER_LABELS.POLL,
userData,
},
]);
}
});
}
});

Expand Down

0 comments on commit e73eb3a

Please sign in to comment.