Skip to content

Commit

Permalink
Adding heartbeat for the webcrawler workflow (#3161)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric authored Jan 11, 2024
1 parent 96ed9b7 commit 4ee043b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions connectors/src/connectors/webcrawler/temporal/activities.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ModelId } from "@dust-tt/types";
import { Context } from "@temporalio/activity";
import { CheerioCrawler, Configuration } from "crawlee";
import turndown from "turndown";

Expand Down Expand Up @@ -45,6 +46,9 @@ export async function crawlWebsiteByConnectorId(connectorId: ModelId) {
maxConcurrency: CONCURRENCY,

async requestHandler({ $, request, enqueueLinks }) {
Context.current().heartbeat({
type: "http_request",
});
const extracted = new turndown()
.remove(["style", "script", "iframe"])
.turndown($.html());
Expand Down

0 comments on commit 4ee043b

Please sign in to comment.