diff options
Diffstat (limited to 'reloadMtime.go')
| -rw-r--r-- | reloadMtime.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/reloadMtime.go b/reloadMtime.go index fa4708f..bc754b3 100644 --- a/reloadMtime.go +++ b/reloadMtime.go @@ -9,7 +9,7 @@ import ( "path/filepath" "time" - "go.wit.com/lib/config" + "go.wit.com/lib/cobol" "go.wit.com/log" "google.golang.org/protobuf/types/known/timestamppb" ) @@ -52,7 +52,7 @@ func (repo *Repo) changedDir() bool { return false } dur := mtime.AsTime().Sub(pbtime.AsTime()) - repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur)) + repo.StateChange = fmt.Sprintf("%s changed %s", fname, cobol.FormatDuration(dur)) repo.Times.MtimeDir = mtime return true } @@ -73,7 +73,7 @@ func (repo *Repo) didFileChange(fname string, pbtime *timestamppb.Timestamp) boo return false } dur := mtime.AsTime().Sub(pbtime.AsTime()) - repo.StateChange = fmt.Sprintf("%s mtime changed %s", fname, config.FormatDuration(dur)) + repo.StateChange = fmt.Sprintf("%s mtime changed %s", fname, cobol.FormatDuration(dur)) // need to reload from the filesystem return true } @@ -104,7 +104,7 @@ func (repo *Repo) updateMtime(fname string, pbname string) bool { return false } dur := mtime.AsTime().Sub(pbtime.AsTime()) - repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur)) + repo.StateChange = fmt.Sprintf("%s changed %s", fname, cobol.FormatDuration(dur)) repo.Times.MtimeHead = mtime return true } @@ -127,7 +127,7 @@ func (repo *Repo) changedHead() bool { return false } dur := mtime.AsTime().Sub(pbtime.AsTime()) - repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur)) + repo.StateChange = fmt.Sprintf("%s changed %s", fname, cobol.FormatDuration(dur)) repo.Times.MtimeHead = mtime return true } @@ -152,7 +152,7 @@ func (repo *Repo) changedConfig() bool { return false } dur := mtime.AsTime().Sub(pbtime.AsTime()) - repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur)) + repo.StateChange = fmt.Sprintf("%s changed %s", fname, cobol.FormatDuration(dur)) repo.Times.MtimeConfig = mtime return true } @@ -174,7 +174,7 @@ func (repo *Repo) changedIndex() bool { return false } dur := mtime.AsTime().Sub(pbtime.AsTime()) - repo.StateChange = fmt.Sprintf("%s changed %s", fname, config.FormatDuration(dur)) + repo.StateChange = fmt.Sprintf("%s changed %s", fname, cobol.FormatDuration(dur)) repo.Times.MtimeIndex = mtime return true } @@ -306,7 +306,7 @@ func (r *Repo) didRepoChangeVerbose() (bool, error) { lastupdate := r.Times.LastUpdate.AsTime() dur := time.Since(lastupdate) if dur < 5*time.Minute { - log.Info("repo.ReloadMtime() was was last run", config.FormatDuration(dur), r.Namespace) + log.Info("repo.ReloadMtime() was was last run", cobol.FormatDuration(dur), r.Namespace) output = true } } else { @@ -335,7 +335,7 @@ func (r *Repo) didRepoChangeVerbose() (bool, error) { lastupdate := r.Times.LastUpdate.AsTime() dur := time.Since(lastupdate) if dur < 5*time.Minute { - log.Info("repo.ReloadMtime() MtimeDir last run", config.FormatDuration(dur), r.Namespace) + log.Info("repo.ReloadMtime() MtimeDir last run", cobol.FormatDuration(dur), r.Namespace) r.RunVerbose([]string{"ls", "-l", ".git", "-d"}) output = true } |
