remove dir after running checks

This commit is contained in:
Shawn Smith
2021-11-21 20:59:07 +09:00
parent a775878f48
commit afdab31f67

View File

@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"log"
"os"
"strings"
"time"
@@ -109,6 +110,13 @@ func newChecksResp(db *badger.DB, repo string, forceRefresh bool) (checksResp, e
return checksResp{}, err
}
defer func() {
err := os.RemoveAll(dirName(repo))
if err != nil {
log.Println("ERROR: could not remove dir:", err)
}
}()
t := time.Now().UTC()
resp := checksResp{
Checks: checkResult.Checks,