Skip to content

Commit

Permalink
Remove site cache (but keep scene cache) when scraping from UI
Browse files Browse the repository at this point in the history
  • Loading branch information
cld9x committed May 27, 2019
1 parent 5bf9c8b commit 4f8d66d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/xbvr/task_content.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package xbvr

import (
"os"
"path/filepath"
"time"

"github.com/cld9x/xbvr/pkg/scrape"
Expand All @@ -25,6 +27,8 @@ func Scrape() {

tlog := log.WithField("task", "scrape")

os.RemoveAll(filepath.Join(cacheDir, "site_cache"))

// Get all known scenes
var scenes []Scene
db, _ := GetDB()
Expand Down Expand Up @@ -90,8 +94,6 @@ func ImportBundle() {
var bundleData Bundle
resp, err := resty.R().SetResult(&bundleData).Get("http://127.0.0.1:9999/static/bundle.json")

tlog.Info(err)

if err == nil && resp.StatusCode() == 200 {
db, _ := GetDB()
for i := range bundleData.Scenes {
Expand Down

0 comments on commit 4f8d66d

Please sign in to comment.