Skip to content

Commit

Permalink
Fix cron stopped after first trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Jul 24, 2019
1 parent 6d95ca7 commit 747ef55
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 6.0.1 (2019/07/24)

* Fix cron stopped after first trigger

## 6.0.0 (2019/07/21)

* Log skip status
Expand Down
9 changes: 7 additions & 2 deletions internal/app/ftpgrab.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,12 @@ func (fg *FtpGrab) Run() {
fg.retrieveRecursive(src, src, dest)
}

fg.Close()
if err := fg.srv.Close(); err != nil {
log.Warn().Err(err).Msg("Cannot close server connection")
}
if err := fg.db.Close(); err != nil {
log.Warn().Err(err).Msg("Cannot close database")
}
fg.jnl.Duration = time.Since(start)

log.Info().
Expand All @@ -160,7 +165,7 @@ func (fg *FtpGrab) Run() {
fg.notif.Send(*fg.jnl)
}

// Close closes ftpgrab (ftp and db connection)
// Close closes ftpgrab
func (fg *FtpGrab) Close() {
if err := fg.srv.Close(); err != nil {
log.Warn().Err(err).Msg("Cannot close server connection")
Expand Down

0 comments on commit 747ef55

Please sign in to comment.