added onStatus hook

This commit is contained in:
Shlomi Noach 2016-08-22 16:24:41 +02:00
parent 6acbe7e3ae
commit 972728cf40
2 changed files with 8 additions and 0 deletions

View File

@ -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
}

View File

@ -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