Skip to content

Commit

Permalink
adding the correct names
Browse files Browse the repository at this point in the history
Signed-off-by: Yashvi Jain <yashvi.jain@progress.com>
  • Loading branch information
Yashvi Jain committed Oct 18, 2022
1 parent 2f82418 commit d080256
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 6 deletions.
3 changes: 0 additions & 3 deletions components/compliance-service/ingest/ingestic/ingestic.go
Original file line number Diff line number Diff line change
Expand Up @@ -1222,9 +1222,6 @@ func (backend *ESClient) GetReportsDailyLatestTrue(ctx context.Context, upgradeT
boolQuery := elastic.NewBoolQuery().
Must(elastic.NewTermQuery("daily_latest", true)).Must(rangeQuery)

src, _ := boolQuery.Source()
logrus.Infof("Test Query For upgrade is noow : %v", src)

fsc := elastic.NewFetchSourceContext(true).Include(
"report_uuid",
"node_uuid",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ func (t *UpgradeTask) Run(ctx context.Context, task cereal.Task) (interface{}, e
return nil, err
}

logrus.Info("Inside the upgrades flag flow")
logrus.Infof("Upgrade started at time %v", time.Now())
if job.ControlFlag {

logrus.Info("Inside the control flag")
if err := performActionForUpgrade(ctx, t.ESClient, job.UpgradeDate); err != nil {
logrus.WithError(err).Error("Unable to upgrade control index flag for latest record ")
Expand Down Expand Up @@ -159,7 +159,7 @@ type ControlIndexUpgradeTask struct {

func performActionForUpgrade(ctx context.Context, esClient *ingestic.ESClient, upgradeTime time.Time) error {
mapping := mappings.ComplianceRepDate
if time.Now().Sub(upgradeTime)/24 > 90 {
if time.Now().Sub(upgradeTime).Hours()/24 > 90 {
upgradeTime = time.Now().Add(-24 * time.Hour * 90)
}
reportsMap, latestReportsMap, err := esClient.GetReportsDailyLatestTrue(ctx, upgradeTime)
Expand Down
1 change: 0 additions & 1 deletion components/compliance-service/migrations/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ func NewService(pg *pgdb.UpgradesDB, cerealManger *cereal.Manager) *Upgrade {
}

//PollForUpgradeFlagDayLatest checks for the day latest flag value in upgrade flags
//TODO:: run the upgrade from current date to upgradeDate
func (u *Upgrade) PollForUpgradeFlagDayLatest(upgradeDate time.Time) error {
logrus.Infof("upgrade will run from %s to till now", upgradeDate.String())
controlFlag, err := u.getUpgradeFlag(pgdb.ControlIndexFlag)
Expand Down

0 comments on commit d080256

Please sign in to comment.