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

Commit

Permalink
Caching clean up (#19)
Browse files Browse the repository at this point in the history
* clean up caching

Signed-off-by: Ayman <[email protected]>

* clean up caching

Signed-off-by: Ayman <[email protected]>

* code clean up

Signed-off-by: Ayman <[email protected]>

---------

Signed-off-by: Ayman <[email protected]>
Co-authored-by: Ayman <[email protected]>
  • Loading branch information
khalifapro and enkhalifapro authored Jan 31, 2023
1 parent bc1af30 commit 49b5b20
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions cmd/jira/jira.go
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,6 @@ func (j *DSJira) OutputDocs(ctx *shared.Ctx, items []interface{}, docs *[]interf
insightsStr := "insights"
issuesStr := "issues"
envStr := os.Getenv("STAGE")
data := make([]map[string]interface{}, 0)
for k, v := range issuesData {
switch k {
case "created":
Expand Down Expand Up @@ -727,10 +726,6 @@ func (j *DSJira) OutputDocs(ctx *shared.Ctx, items []interface{}, docs *[]interf
if err = j.cacheProvider.UpdateFileByKey(j.endpoint, commentsCacheFile, comB); err != nil {
return
}
err = j.cacheProvider.Create(fmt.Sprintf("%s/%s", j.endpoint, JiraIssue), data)
if err != nil {
j.log.WithFields(logrus.Fields{"operation": "OutputDocs"}).Errorf("error creating cache for endpoint %s/%s. Error: %+v", j.endpoint, JiraIssue, err)
}
} else {
jsonBytes, err = jsoniter.Marshal(issuesData)
}
Expand Down Expand Up @@ -1821,6 +1816,7 @@ func (j *DSJira) Sync(ctx *shared.Ctx) (err error) {
j.log.WithFields(logrus.Fields{"operation": "Sync"}).Infof("%s resuming from %v (%d threads)", j.Endpoint(ctx), ctx.DateFrom, thrN)
}
}
cachedIssues = make(map[string]EntityCache)
j.getCachedIssues()
if err = j.getCachedComments(); err != nil {
return
Expand Down

0 comments on commit 49b5b20

Please sign in to comment.