Handle age timestamping errors in syncLists

This commit is contained in:
2026-01-08 19:05:23 -05:00
parent d21de424cb
commit 07571a698d
2 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
**libmutton v0.5.0** **libmutton v0.5.0**
Release date TBD Release date TBD
This release adds password age tracking support and features large refactors that improve the robustness of core functionality. Many breaking changes are present. Highlights are listed below. This release adds password age-tracking support and features large refactors that improve the robustness of core functionality. Many breaking changes are present. Highlights are listed below.
## Breaking (for users+developers) ## Breaking (for users+developers)
- **USERS**: These changes *require* updating your copy of `libmuttonserver`; additionally, you *must* re-generate your config file however your client allows (e.g. `mutn init`) - **USERS**: These changes *require* updating your copy of `libmuttonserver`; additionally, you *must* re-generate your config file however your client allows (e.g. `mutn init`)
+6 -2
View File
@@ -293,7 +293,9 @@ func syncLists(sshClient *ssh.Client, sshEntryRoot string, sshIsWindows bool, ti
fmt.Println(back.AnsiGreen+vanityPath+back.AnsiReset, "is newer on server, adding to download list") fmt.Println(back.AnsiGreen+vanityPath+back.AnsiReset, "is newer on server, adding to download list")
downloadList = append(downloadList, vanityPath) downloadList = append(downloadList, vanityPath)
if remoteInfo.AgeTimestamp != nil { if remoteInfo.AgeTimestamp != nil {
age.Entry(vanityPath, *remoteInfo.AgeTimestamp) if err := age.Entry(vanityPath, *remoteInfo.AgeTimestamp); err != nil {
return [3][]string{nil, nil, nil}, errors.New("unable to update age timestamp for " + vanityPath + ": " + err.Error())
}
} }
} else if remoteInfo.ModTime < localInfo.ModTime { } else if remoteInfo.ModTime < localInfo.ModTime {
fmt.Println(back.AnsiBlue+vanityPath+back.AnsiReset, "is newer on client, adding to upload list") fmt.Println(back.AnsiBlue+vanityPath+back.AnsiReset, "is newer on client, adding to upload list")
@@ -315,7 +317,9 @@ func syncLists(sshClient *ssh.Client, sshEntryRoot string, sshIsWindows bool, ti
return [3][]string{nil, nil, nil}, errors.New("unable to create containing folder for " + vanityPath + ": " + err.Error()) return [3][]string{nil, nil, nil}, errors.New("unable to create containing folder for " + vanityPath + ": " + err.Error())
} }
if remoteInfo.AgeTimestamp != nil { if remoteInfo.AgeTimestamp != nil {
age.Entry(vanityPath, *remoteInfo.AgeTimestamp) if err := age.Entry(vanityPath, *remoteInfo.AgeTimestamp); err != nil {
return [3][]string{nil, nil, nil}, errors.New("unable to update age timestamp for " + vanityPath + ": " + err.Error())
}
} }
} }