mirror of
https://git.sr.ht/~phw/scotty
synced 2025-06-05 04:58:33 +02:00
Fixed import log output duplicating
This commit is contained in:
parent
b1b0df7763
commit
312d9860cf
4 changed files with 39 additions and 9 deletions
|
@ -196,11 +196,21 @@ func (i *ImportResult) UpdateTimestamp(newTime time.Time) {
|
|||
}
|
||||
}
|
||||
|
||||
func (i *ImportResult) Update(from ImportResult) {
|
||||
i.TotalCount = from.TotalCount
|
||||
i.ImportCount = from.ImportCount
|
||||
i.UpdateTimestamp(from.LastTimestamp)
|
||||
i.ImportLog = append(i.ImportLog, from.ImportLog...)
|
||||
func (i *ImportResult) Update(from *ImportResult) {
|
||||
if i != from {
|
||||
i.TotalCount = from.TotalCount
|
||||
i.ImportCount = from.ImportCount
|
||||
i.UpdateTimestamp(from.LastTimestamp)
|
||||
i.ImportLog = append(i.ImportLog, from.ImportLog...)
|
||||
}
|
||||
}
|
||||
|
||||
func (i *ImportResult) Copy() ImportResult {
|
||||
return ImportResult{
|
||||
TotalCount: i.TotalCount,
|
||||
ImportCount: i.ImportCount,
|
||||
LastTimestamp: i.LastTimestamp,
|
||||
}
|
||||
}
|
||||
|
||||
func (i *ImportResult) Log(t LogEntryType, msg string) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue