🌱 feat: add heartbeat mechanism with dev bot check#2177
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a dev-bot guard to the existing heartbeat mechanism so development deployments don’t emit the heartbeat file updates.
Changes:
- Add a
config.IsDevBot()early-return instartHeartbeatto disable heartbeats for the dev bot. - Add a function comment describing the heartbeat behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| return i.Member.User.ID | ||
| } | ||
|
|
||
| // Heartbeat function to update the modification time of a file at regular intervals |
There was a problem hiding this comment.
The function-level comment is now slightly inaccurate because startHeartbeat can be a no-op when config.IsDevBot() is true. Consider updating the comment to mention that the heartbeat is skipped for the dev bot so the behavior matches the documentation.
| // Heartbeat function to update the modification time of a file at regular intervals | |
| // Heartbeat function to update the modification time of a file at regular intervals; | |
| // when running as the dev bot (config.IsDevBot() == true) this is a no-op. |
| func startHeartbeat(filepath string, interval time.Duration) { | ||
| if config.IsDevBot() { | ||
| return | ||
|
|
There was a problem hiding this comment.
There’s an extra blank line inside the if config.IsDevBot() block after return. Please remove it to keep the control flow block tidy (and avoid unnecessary diffs if gofmt/lint rules are enforced).
No description provided.