Skip to content
This repository was archived by the owner on May 24, 2024. It is now read-only.

Commit a362082

Browse files
Fix long running tasks (#78)
* disable concurency Signed-off-by: Ayman <[email protected]> * change pack size Signed-off-by: Ayman <[email protected]> * clean up Signed-off-by: Ayman <[email protected]> --------- Signed-off-by: Ayman <[email protected]> Co-authored-by: Ayman <[email protected]>
1 parent 72a0f31 commit a362082

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

cmd/git/git.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"encoding/json"
1111
"flag"
1212
"fmt"
13+
"github.com/LF-Engineering/insights-datasource-shared/aws"
1314
"io"
1415
"math"
1516
"net/url"
@@ -24,7 +25,6 @@ import (
2425

2526
"github.com/LF-Engineering/insights-datasource-git/build"
2627
shared "github.com/LF-Engineering/insights-datasource-shared"
27-
"github.com/LF-Engineering/insights-datasource-shared/aws"
2828
"github.com/LF-Engineering/insights-datasource-shared/cache"
2929
elastic "github.com/LF-Engineering/insights-datasource-shared/elastic"
3030
logger "github.com/LF-Engineering/insights-datasource-shared/ingestjob"
@@ -98,6 +98,7 @@ const (
9898
Success = "success"
9999
// GitConnector ...
100100
GitConnector = "git-connector"
101+
PackSize = 300
101102
)
102103

103104
var (
@@ -760,6 +761,7 @@ func (j *DSGit) Init(ctx *shared.Ctx) (err error) {
760761
ctx.InitEnv("git")
761762
j.AddFlags()
762763
ctx.Init()
764+
ctx.PackSize = PackSize
763765
err = j.ParseArgs(ctx)
764766
if err != nil {
765767
return
@@ -2436,7 +2438,7 @@ func (j *DSGit) ParseNextCommit(ctx *shared.Ctx) (commit map[string]interface{},
24362438

24372439
// Sync - sync git data source
24382440
func (j *DSGit) Sync(ctx *shared.Ctx) (err error) {
2439-
thrN := shared.GetThreadsNum(ctx)
2441+
thrN := 1 //shared.GetThreadsNum(ctx)
24402442
lastSync := os.Getenv("LAST_SYNC")
24412443
if lastSync != "" {
24422444
i, err := strconv.ParseInt(lastSync, 10, 64)

0 commit comments

Comments
 (0)