@@ -3431,15 +3431,20 @@ func (j *DSGit) createCacheFile(cache []CommitCache, path string) error {
3431
3431
3432
3432
func (j * DSGit ) createYearHalfCacheFile (cache []CommitCache , path string ) error {
3433
3433
nextYearHalfCache := make ([]CommitCache , 0 )
3434
+ currentYearCommitsCount := 0
3434
3435
for _ , comm := range cache {
3435
3436
comm .FileLocation = path
3436
3437
commitYearHalf := getDateYearHalf (comm .CommitDate )
3437
3438
if comm .CommitDate .Year () == CurrentCacheYear && commitYearHalf == CurrentCacheYearHalf {
3438
3439
cachedCommits [comm .EntityID ] = comm
3440
+ currentYearCommitsCount ++
3439
3441
} else {
3440
3442
nextYearHalfCache = append (nextYearHalfCache , comm )
3441
3443
}
3442
3444
}
3445
+ if currentYearCommitsCount == 0 {
3446
+ return nil
3447
+ }
3443
3448
records := [][]string {
3444
3449
{"timestamp" , "entity_id" , "source_entity_id" , "file_location" , "hash" , "orphaned" , "from_dl" , "content" },
3445
3450
}
@@ -3472,13 +3477,14 @@ func (j *DSGit) createYearHalfCacheFile(cache []CommitCache, path string) error
3472
3477
if err != nil {
3473
3478
return err
3474
3479
}
3480
+
3475
3481
if len (nextYearHalfCache ) > 0 {
3476
3482
CurrentCacheYear = nextYearHalfCache [0 ].CommitDate .Year ()
3477
3483
CurrentCacheYearHalf = YearFirstHalf
3478
3484
if nextYearHalfCache [0 ].CommitDate .Month () > 6 {
3479
3485
CurrentCacheYearHalf = YearSecondHalf
3480
3486
}
3481
- updateYearHalf (nextYearHalfCache [0 ].CommitDate )
3487
+ // updateYearHalf(nextYearHalfCache[0].CommitDate)
3482
3488
if err = j .createYearHalfCacheFile (nextYearHalfCache , path ); err != nil {
3483
3489
return err
3484
3490
}
0 commit comments