Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/bots/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@ AWS_SECRET_ACCESS_KEY=your_secret_access_key
AWS_BUCKET_NAME=your_bucket_name
AWS_REGION=your_region

# Usefull for debugging. If you set to =false, then any failure in the heartbeat ping will not be logged.
HEARTBEAT_DEBUG=true
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] set to false by default


# Bot data (example - this will be set by the backend)
BOT_DATA={"botId":1,"meetingUrl":"https://meet.google.com/xxx-xxxx-xxx","botName":"Meeting Bot","recordingPath":"./recording.mp4","automaticLeave":{"waitingRoomTimeout":300000,"noOneJoinedTimeout":300000,"everyoneLeftTimeout":300000}}
5 changes: 4 additions & 1 deletion src/bots/src/monitoring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ export const startHeartbeat = async (
await trpc.bots.heartbeat.mutate({ id: botId });
console.log(`[${new Date().toISOString()}] Heartbeat sent`);
} catch (error) {
console.error("Failed to send heartbeat:", error);

// Do not log the entire heartbeat error if, in local, the user has set HEARTBEAT_DEBUG to false.
if ((process.env?.HEARTBEAT_DEBUG ?? 'true') !== 'false')
console.error("Failed to send heartbeat:", error);
}
await setTimeout(5000); // Send heartbeat every 5 seconds
}
Expand Down