mirror of
https://github.com/MichaelMure/git-bug.git
synced 2024-12-14 08:45:30 +03:00
Merge pull request #272 from MichaelMure/fix-import-time-save
bridge: fix incorrect last import time on context cancel
This commit is contained in:
commit
69af7a1e0c
@ -78,7 +78,7 @@ func (gi *githubImporter) ImportAll(ctx context.Context, repo *cache.RepoCache,
|
||||
}
|
||||
}
|
||||
|
||||
if err := gi.iterator.Error(); err != nil && err != context.Canceled {
|
||||
if err := gi.iterator.Error(); err != nil {
|
||||
gi.out <- core.NewImportError(err, "")
|
||||
}
|
||||
}()
|
||||
|
@ -96,15 +96,25 @@ func runBridgePull(cmd *cobra.Command, args []string) error {
|
||||
importedIssues := 0
|
||||
importedIdentities := 0
|
||||
for result := range events {
|
||||
if result.Event != core.ImportEventNothing {
|
||||
fmt.Println(result.String())
|
||||
}
|
||||
|
||||
switch result.Event {
|
||||
case core.ImportEventNothing:
|
||||
// filtered
|
||||
|
||||
case core.ImportEventBug:
|
||||
importedIssues++
|
||||
fmt.Println(result.String())
|
||||
|
||||
case core.ImportEventIdentity:
|
||||
importedIdentities++
|
||||
fmt.Println(result.String())
|
||||
|
||||
case core.ImportEventError:
|
||||
if result.Err != context.Canceled {
|
||||
fmt.Println(result.String())
|
||||
}
|
||||
|
||||
default:
|
||||
fmt.Println(result.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user