Skip to content

Commit

Permalink
Heartbeats.
Browse files Browse the repository at this point in the history
  • Loading branch information
ejholmes committed Dec 31, 2015
1 parent b60190e commit 54d0e44
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions server/github/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ package github

import (
"io"
"time"

"github.com/docker/docker/pkg/jsonmessage"
"github.com/docker/docker/pkg/term"
"github.com/ejholmes/hookshot/events"
"github.com/remind101/empire"
streamhttp "github.com/remind101/empire/pkg/stream/http"
"github.com/remind101/pkg/trace"
"github.com/remind101/tugboat"
"golang.org/x/net/context"
Expand Down Expand Up @@ -114,6 +116,10 @@ func (d *tugboatDeployer) Deploy(ctx context.Context, p events.Deployment, out i
// write hte logs to tugboat and update the deployment status when this
// function returns.
_, err := d.client.Deploy(ctx, opts, provider(func(ctx context.Context, _ *tugboat.Deployment, w io.Writer) error {
// If tugboat is running on something like Heroku, we need to
// send some occasional heartbeats.
w = streamhttp.Heartbeat(w, time.Second*30)

// Write logs to both tugboat as well as the writer we were
// provided (probably stdout).
w = io.MultiWriter(w, out)
Expand Down

0 comments on commit 54d0e44

Please sign in to comment.