diff options
| author | Jeff Carr <[email protected]> | 2025-01-18 23:26:41 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-01-18 23:26:41 -0600 |
| commit | 723ca5e8291881ed5dff84445aa8c6d494c0f364 (patch) | |
| tree | cfa6a18307ec8b424f5cfc0c37f9ad3fe95845bd | |
| parent | 93e4eae19d13f709e2a50e5f7d484e066d526c3d (diff) | |
add os.Stat() check for Reload()
| -rw-r--r-- | reload.go | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -8,7 +8,18 @@ import ( timestamppb "google.golang.org/protobuf/types/known/timestamppb" ) -// TODO: fix and clean this up. this is a work in progress +// does a fast check with os.Stat() +// if the mtimes changed, does a full repo.Reload() +func (repo *Repo) ReloadCheck() error { + if !repo.DidRepoChange() { + return nil + } + // f.configSave = true + err := repo.Reload() + return err +} + +// TODO: clean this up more, but it is working now more or less func (repo *Repo) Reload() error { // log.Info("in reload", repo.FullPath) repo.Tags = new(GitTags) |
