large refactoring, bug fixes, performance improvement

This commit is contained in:
yusing
2024-03-18 04:51:59 +00:00
parent eee6ff4f15
commit a52b1bcadd
27 changed files with 1530 additions and 419 deletions

View File

@@ -14,7 +14,7 @@ import (
"sync"
"time"
"github.com/golang/glog"
"github.com/sirupsen/logrus"
xhtml "golang.org/x/net/html"
)
@@ -111,10 +111,9 @@ func tryAppendPathPrefixImpl(pOrig, pAppend string) string {
var tryAppendPathPrefix func(string, string) string
var _ = func() int {
if glog.V(4) {
if logLevel == logrus.DebugLevel {
tryAppendPathPrefix = func(s1, s2 string) string {
replaced := tryAppendPathPrefixImpl(s1, s2)
glog.Infof("[Path sub] %s -> %s", s1, replaced)
return replaced
}
} else {
@@ -192,4 +191,4 @@ func (*Utils) respJSSubPath(r *http.Response, p string) error {
func (*Utils) fileOK(path string) bool {
_, err := os.Stat(path)
return err == nil
}
}