Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 0d711ae

Browse files
committed
Tweaking
1 parent c5015ee commit 0d711ae

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/main/java/com/searchcode/app/jobs/repository/IndexBaseRepoJob.java

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,11 @@ public void execute(JobExecutionContext context) throws JobExecutionException {
131131
if (repoResult != null && !Singleton.getRunningIndexRepoJobs().containsKey(repoResult.getName())) {
132132
this.haveRepoResult = true;
133133
this.logger.info(String.format("1d980f51::indexing repository %s", repoResult.getName()));
134-
repoResult.getData().indexStatus = "indexing";
135-
repoResult.getData().indexError = Values.EMPTYSTRING;
136-
Singleton.getRepo().saveRepo(repoResult);
134+
if (repoResult.getData() != null) {
135+
repoResult.getData().indexStatus = "indexing";
136+
repoResult.getData().indexError = Values.EMPTYSTRING;
137+
Singleton.getRepo().saveRepo(repoResult);
138+
}
137139

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

181183
int runningTime = Singleton.getHelpers().getCurrentTimeSeconds() - Singleton.getRunningIndexRepoJobs().get(repoResult.getName()).startTime;
182-
repoResult.getData().averageIndexTimeSeconds = (repoResult.getData().averageIndexTimeSeconds + runningTime) / 2;
183-
repoResult.getData().indexStatus = "success";
184-
repoResult.getData().jobRunTime = jobStartTime;
185-
Singleton.getRepo().saveRepo(repoResult);
184+
185+
if (repoResult.getData() != null) {
186+
repoResult.getData().averageIndexTimeSeconds = (repoResult.getData().averageIndexTimeSeconds + runningTime) / 2;
187+
repoResult.getData().indexStatus = "success";
188+
repoResult.getData().jobRunTime = jobStartTime;
189+
Singleton.getRepo().saveRepo(repoResult);
190+
}
186191
}
187192

188193
/**

0 commit comments

Comments
 (0)