Skip to content

Commit

Permalink
fix #github buffer flush
Browse files Browse the repository at this point in the history
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
  • Loading branch information
slimsag committed Apr 30, 2024
1 parent b145a34 commit 871aeed
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/wrench/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ func (b *Bot) discordGitHubPushEvent(ev *github.PushEvent) error {
ellipsis(commitTitle(commit.GetMessage()), 60),
commit.Author.GetLogin(),
)
if len(out.String())+len(add) >= 4000 {
flush()
if len(out.String())+len(add) >= 2000 {
if err := flush(); err != nil {
return err
}
out.Reset()
}
fmt.Fprintf(&out, "%s", add)
Expand Down

0 comments on commit 871aeed

Please sign in to comment.