From bae81d9b0854a35589357f4868747c7bbe5b4b27 Mon Sep 17 00:00:00 2001 From: Philipp Wolfer Date: Wed, 15 Nov 2023 09:20:52 +0100 Subject: [PATCH] If import fails report the last timestamp --- cmd/listens.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/listens.go b/cmd/listens.go index 2f5db59..f9dafe9 100644 --- a/cmd/listens.go +++ b/cmd/listens.go @@ -67,7 +67,10 @@ var listensCmd = &cobra.Command{ // Import into target result, err := importBackend.ImportListens(listens, timestamp) - cobra.CheckErr(err) + if err != nil { + fmt.Printf("Import failed, last reported timestamp was %v (%v)\n", result.LastTimestamp, result.LastTimestamp.Unix()) + cobra.CheckErr(err) + } fmt.Printf("Imported %v of %v listens into %v.\n", result.ImportCount, result.TotalCount, targetName)