Skip to content

Commit

Permalink
feat(sync): add the time of last sync (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
nobe4 authored Sep 19, 2024
1 parent 2a63bf5 commit cd7a2df
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion internal/cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package cmd
import (
"fmt"
"log/slog"
"time"

"github.com/cli/go-gh/v2/pkg/text"
"github.com/nobe4/gh-not/internal/api"
"github.com/nobe4/gh-not/internal/api/file"
"github.com/nobe4/gh-not/internal/api/github"
Expand Down Expand Up @@ -89,7 +91,15 @@ func runSync(cmd *cobra.Command, args []string) error {
return err
}

fmt.Printf("Loaded %d, refreshed %d, visible %d\n", loadedNotifications, refreshedNotifications, visibleNotifications)
fmt.Printf("Loaded %d, refreshed %d, visible %d at %s\n",
loadedNotifications,
refreshedNotifications,
visibleNotifications,
text.RelativeTimeAgo(
time.Now(),
manager.Cache.RefreshedAt(),
),
)

return nil
}

0 comments on commit cd7a2df

Please sign in to comment.