Fix PAC error in test script.

This commit is contained in:
Chen Yufei
2015-06-03 11:18:32 +08:00
parent 80f857929e
commit cf262fafb8
2 changed files with 6 additions and 1 deletions

View File

@@ -88,4 +88,6 @@ if [[ -z $TRAVIS ]]; then
fi
stop_cow
sleep 0.5
rm -f ./script/stat*
exit 0

View File

@@ -426,11 +426,14 @@ var siteStat = newSiteStat()
func initSiteStat() {
err := siteStat.load(config.StatFile)
if err != nil {
// Simply try to load the stat.back
// Simply try to load the stat.back, create a new object to avoid error
// in default site list.
siteStat = newSiteStat()
err = siteStat.load(config.StatFile + ".bak")
// After all its not critical , simply re-create a stat object if anything is not ok
if err != nil {
siteStat = newSiteStat()
siteStat.load("") // load default site list
}
}