From 972728cf40f468f9dbb646cbf0a3ba21fc4a720c Mon Sep 17 00:00:00 2001 From: Shlomi Noach Date: Mon, 22 Aug 2016 16:24:41 +0200 Subject: [PATCH] added onStatus hook --- go/logic/hooks.go | 4 ++++ go/logic/migrator.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/go/logic/hooks.go b/go/logic/hooks.go index c6c5981..58c1403 100644 --- a/go/logic/hooks.go +++ b/go/logic/hooks.go @@ -108,3 +108,7 @@ func (this *HooksExecutor) onSuccess() error { func (this *HooksExecutor) onFailure() error { return nil } + +func (this *HooksExecutor) onStatus(statusMessage string) error { + return nil +} diff --git a/go/logic/migrator.go b/go/logic/migrator.go index efad40a..9d1ba6a 100644 --- a/go/logic/migrator.go +++ b/go/logic/migrator.go @@ -1065,6 +1065,10 @@ func (this *Migrator) printStatus(rule PrintStatusRule, writers ...io.Writer) { ) w := io.MultiWriter(writers...) fmt.Fprintln(w, status) + + if elapsedSeconds%60 == 0 { + this.hooksExecutor.onStatus(status) + } } // initiateHeartbeatListener listens for heartbeat events. gh-ost implements its own