Skip to content

Commit

Permalink
fix: post success and fail for each site
Browse files Browse the repository at this point in the history
  • Loading branch information
dzehnder committed Mar 4, 2025
1 parent 4bb8b76 commit 5b7d9bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/support/slack/commands/run-scrape.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ function RunScrapeCommand(context) {
await Promise.all(
csvData.map(async (row) => {
const [csvBaseURL] = row;
return scrapeSite(csvBaseURL, slackContext);
try {
const result = await scrapeSite(csvBaseURL, slackContext);
say(`:white_check_mark: Completed scrape for ${csvBaseURL}`);
return result;
} catch (error) {
say(`::warning:Failed scrape for ${csvBaseURL}: ${error.message}`);
return null;
}
}),
);
} else if (hasText(baseURL)) {
Expand Down
1 change: 1 addition & 0 deletions src/support/slack/slack-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ function SlackHandler(commands, log) {
threadTs,
client,
user: event?.user,
botToken: context.botToken || process.env.SLACK_BOT_TOKEN,
files: event?.files,
};

Expand Down

0 comments on commit 5b7d9bf

Please sign in to comment.