Skip to content

Commit

Permalink
fix bug that caused cache to be repeatedly refreshed
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewarren committed Nov 1, 2019
1 parent b70b09a commit 5aa3c24
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions enclaves.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"

Expand Down Expand Up @@ -59,8 +60,9 @@ func setupEnclaveCache() error {
return err
}

stats := enclaveCache.Stats()
if stats.Items == 0 {
// get the number of files in the directory
files, _ := ioutil.ReadDir(dir)
if len(files) == 0 {
return fillEnclaveCache()
}

Expand Down

0 comments on commit 5aa3c24

Please # to comment.