File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -149,7 +149,8 @@ export class RepoIndexManager {
149149 }
150150
151151 private async scheduleCleanupJobs ( ) {
152- const thresholdDate = new Date ( Date . now ( ) - this . settings . repoGarbageCollectionGracePeriodMs ) ;
152+ const gcGracePeriodMs = new Date ( Date . now ( ) - this . settings . repoGarbageCollectionGracePeriodMs ) ;
153+ const timeoutDate = new Date ( Date . now ( ) - this . settings . repoIndexTimeoutMs ) ;
153154
154155 const reposToCleanup = await this . db . repo . findMany ( {
155156 where : {
@@ -158,9 +159,8 @@ export class RepoIndexManager {
158159 } ,
159160 OR : [
160161 { indexedAt : null } ,
161- { indexedAt : { lt : thresholdDate } } ,
162+ { indexedAt : { lt : gcGracePeriodMs } } ,
162163 ] ,
163- // Don't schedule if there are active jobs that were created within the threshold date.
164164 NOT : {
165165 jobs : {
166166 some : {
@@ -178,7 +178,7 @@ export class RepoIndexManager {
178178 } ,
179179 {
180180 createdAt : {
181- gt : thresholdDate ,
181+ gt : timeoutDate ,
182182 }
183183 }
184184 ]
You can’t perform that action at this time.
0 commit comments