Skip to content

Commit

Permalink
bug: fixes overwriting the bundles during export #309 (#310)
Browse files Browse the repository at this point in the history
* bug: fixes overwriting the bundles during export #309

* bug: fixes overwriting the sf bundles during export #309
  • Loading branch information
srinandan authored Oct 5, 2023
1 parent a9e08e9 commit 8e33e2f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions internal/client/apis/apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ func ExportProxies(conn int, folder string, allRevisions bool) (err error) {

for i := 0; i < conn; i++ {
fanOutWg.Add(1)
go exportAPIProxies(&fanOutWg, jobChan, folder, errChan)
go exportAPIProxies(&fanOutWg, jobChan, folder, allRevisions, errChan)
}

for _, proxy := range prxs.Proxies {
Expand All @@ -483,14 +483,14 @@ func ExportProxies(conn int, folder string, allRevisions bool) (err error) {
return nil
}

func exportAPIProxies(wg *sync.WaitGroup, jobs <-chan revision, folder string, errs chan<- error) {
func exportAPIProxies(wg *sync.WaitGroup, jobs <-chan revision, folder string, allRevisions bool, errs chan<- error) {
defer wg.Done()
for {
job, ok := <-jobs
if !ok {
return
}
err := apiclient.FetchBundle("apis", folder, job.name, job.rev, false)
err := apiclient.FetchBundle("apis", folder, job.name, job.rev, allRevisions)
if err != nil {
errs <- err
}
Expand Down
6 changes: 3 additions & 3 deletions internal/client/sharedflows/sharedflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func Export(conn int, folder string, allRevisions bool) (err error) {

for i := 0; i < conn; i++ {
fanOutWg.Add(1)
go exportSharedFlows(&fanOutWg, jobChan, folder, errChan)
go exportSharedFlows(&fanOutWg, jobChan, folder, allRevisions, errChan)
}

for _, proxy := range shrdflows.Flows {
Expand All @@ -357,14 +357,14 @@ func Export(conn int, folder string, allRevisions bool) (err error) {
return nil
}

func exportSharedFlows(wg *sync.WaitGroup, jobs <-chan revision, folder string, errs chan<- error) {
func exportSharedFlows(wg *sync.WaitGroup, jobs <-chan revision, folder string, allRevisions bool, errs chan<- error) {
defer wg.Done()
for {
job, ok := <-jobs
if !ok {
return
}
err := apiclient.FetchBundle("sharedflows", folder, job.name, job.rev, false)
err := apiclient.FetchBundle("sharedflows", folder, job.name, job.rev, allRevisions)
if err != nil {
errs <- err
}
Expand Down

0 comments on commit 8e33e2f

Please sign in to comment.