mirror of
https://git.sr.ht/~phw/scotty
synced 2025-05-10 02:07:05 +02:00
Simplify timestamp comparisons
This commit is contained in:
parent
389c7c6ec1
commit
c305b6c7e3
7 changed files with 14 additions and 14 deletions
|
@ -123,7 +123,7 @@ func (c *TransferCmd[E, I, R]) Transfer(exp backends.ExportProcessor[R], imp bac
|
|||
resultChan := make(chan models.ImportResult)
|
||||
go imp.Process(exportChan, resultChan, importProgress)
|
||||
result := <-resultChan
|
||||
if result.LastTimestamp.Unix() < timestamp.Unix() {
|
||||
if timestamp.After(result.LastTimestamp) {
|
||||
result.LastTimestamp = timestamp
|
||||
}
|
||||
wg.Wait()
|
||||
|
@ -180,7 +180,7 @@ func (c *TransferCmd[E, I, R]) timestamp() (time.Time, error) {
|
|||
}
|
||||
|
||||
func (c *TransferCmd[E, I, R]) updateTimestamp(result models.ImportResult, oldTimestamp time.Time) error {
|
||||
if result.LastTimestamp.Unix() < oldTimestamp.Unix() {
|
||||
if oldTimestamp.After(result.LastTimestamp) {
|
||||
result.LastTimestamp = oldTimestamp
|
||||
}
|
||||
printTimestamp("Latest timestamp: %v (%v)", result.LastTimestamp)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue