diff --git a/fetcher.go b/fetcher.go index 32004f7..ffd9e2c 100644 --- a/fetcher.go +++ b/fetcher.go @@ -24,6 +24,7 @@ func NewFetcher(config *Config, sess *session.Session, journaler *Journaler) *Fe } func (this *Fetcher) Run() (string, error) { + defer this.journaler.Close() var err error if len(this.config.Roles) > 0 { for _, role := range this.config.Roles { diff --git a/journaler.go b/journaler.go index 9f6b305..103413b 100644 --- a/journaler.go +++ b/journaler.go @@ -59,9 +59,11 @@ func (this *Journaler) listen() { } this.journal.Flush() case <-this.quitCh: + fmt.Println("Closing") this.fd.Close() this.wg.Done() - return + break } } + }