]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Improve 优化
authorqydysky <qydysky@foxmail.com>
Sun, 19 Nov 2023 01:02:48 +0000 (09:02 +0800)
committerqydysky <qydysky@foxmail.com>
Sun, 19 Nov 2023 01:02:48 +0000 (09:02 +0800)
Reply/F/genCpuPprof/genCpuPprof.go
bili_danmu.go
demo/config/config_K_v.json

index ba0091503101a9facdfdf44d4d4b6c2b562ca5cf..0608e5bd310b950331e8d3c8b0d5d1109cb1c443 100644 (file)
@@ -12,6 +12,9 @@ import (
 var Start = comp.NewComp(start)
 
 func start(ctx context.Context, file string) error {
+       if file == "" {
+               return nil
+       }
        pgo := pfile.New(file, 0, false)
        if pgo.IsExist() {
                _ = pgo.Delete()
index c0b74ece45d6be211b2864971422fbee357bfdd3..c94dde005f51c3c3176d37639eeca8ec7207b031 100644 (file)
@@ -47,9 +47,11 @@ func Start() {
 
        mainCtx, mainDone := pctx.WithWait(context.Background(), 0, time.Minute)
        defer func() {
-               danmulog.L(`I: `, `等待协程结束`, time.Minute)
-               if e := mainDone(); e != nil {
+               danmulog.L(`I: `, fmt.Sprintf("等待%v协程结束", time.Minute))
+               if e := mainDone(); errors.Is(e, pctx.ErrWaitTo) {
                        danmulog.L(`W: `, `等待退出超时`)
+               } else {
+                       danmulog.L(`I: `, "结束")
                }
        }()
 
index 2dc4e97bce7580148762030276fbb34958a99768..2cc54bfc1890d3fb7e73e85e13881da2d24d55fb 100644 (file)
     "性能路径-help":"当Web服务地址不为空时, 访问此路径可以获取性能信息,为空时关闭",
     "性能路径":"/state",
     "生成pgo-help":"将在退出后生成pgo文件在指定路径,default.pgo将有助于下次构建的优化,但也会导致构建缓慢,为空时不生成",
-    "生成pgo":"default.pgo"
+    "生成pgo":""
 }
\ No newline at end of file