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()
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: `, "结束")
}
}()
"性能路径-help":"当Web服务地址不为空时, 访问此路径可以获取性能信息,为空时关闭",
"性能路径":"/state",
"生成pgo-help":"将在退出后生成pgo文件在指定路径,default.pgo将有助于下次构建的优化,但也会导致构建缓慢,为空时不生成",
- "生成pgo":"default.pgo"
+ "生成pgo":""
}
\ No newline at end of file