Skip to content

Commit

Permalink
Tweaking
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jan 6, 2020
1 parent c5015ee commit 0d711ae
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,11 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
if (repoResult != null && !Singleton.getRunningIndexRepoJobs().containsKey(repoResult.getName())) {
this.haveRepoResult = true;
this.logger.info(String.format("1d980f51::indexing repository %s", repoResult.getName()));
repoResult.getData().indexStatus = "indexing";
repoResult.getData().indexError = Values.EMPTYSTRING;
Singleton.getRepo().saveRepo(repoResult);
if (repoResult.getData() != null) {
repoResult.getData().indexStatus = "indexing";
repoResult.getData().indexError = Values.EMPTYSTRING;
Singleton.getRepo().saveRepo(repoResult);
}

try {
Singleton.getRunningIndexRepoJobs().put(repoResult.getName(),
Expand Down Expand Up @@ -179,10 +181,13 @@ public void triggerIndex(RepoResult repoResult, String repoName, String repoRemo
this.updateIndex(repoResult, repoLocations, repoRemoteLocation, existingRepo, repositoryChanged);

int runningTime = Singleton.getHelpers().getCurrentTimeSeconds() - Singleton.getRunningIndexRepoJobs().get(repoResult.getName()).startTime;
repoResult.getData().averageIndexTimeSeconds = (repoResult.getData().averageIndexTimeSeconds + runningTime) / 2;
repoResult.getData().indexStatus = "success";
repoResult.getData().jobRunTime = jobStartTime;
Singleton.getRepo().saveRepo(repoResult);

if (repoResult.getData() != null) {
repoResult.getData().averageIndexTimeSeconds = (repoResult.getData().averageIndexTimeSeconds + runningTime) / 2;
repoResult.getData().indexStatus = "success";
repoResult.getData().jobRunTime = jobStartTime;
Singleton.getRepo().saveRepo(repoResult);
}
}

/**
Expand Down

0 comments on commit 0d711ae

Please sign in to comment.