mirror of https://github.com/perkeep/perkeep.git
Merge "camweb: make syncing to github concurrent"
This commit is contained in:
commit
286dbacc62
|
@ -243,6 +243,15 @@ func pollCommits(dir string) {
|
|||
latestHash.Lock()
|
||||
latestHash.s = hashes[0]
|
||||
latestHash.Unlock()
|
||||
githubSyncC := make(chan bool, 1)
|
||||
go func() {
|
||||
if githubSSHKey != "" {
|
||||
if err := syncToGithub(dir, hashes[0]); err != nil {
|
||||
log.Printf("Failed to push commit %v to github: %v", hashes[0], err)
|
||||
}
|
||||
}
|
||||
githubSyncC <- true
|
||||
}()
|
||||
for _, commit := range hashes {
|
||||
if knownCommit[commit] {
|
||||
continue
|
||||
|
@ -270,11 +279,7 @@ func pollCommits(dir string) {
|
|||
log.Printf("datastore put of git_commit(%v): %v", commit, err)
|
||||
}
|
||||
}
|
||||
if githubSSHKey != "" {
|
||||
if err := syncToGithub(dir, hashes[0]); err != nil {
|
||||
log.Printf("Failed to push commit %v to github: %v", hashes[0], err)
|
||||
}
|
||||
}
|
||||
<-githubSyncC
|
||||
}
|
||||
|
||||
func recentCommits(dir string) (hashes []string, err error) {
|
||||
|
|
Loading…
Reference in New Issue