improve crashlogs
This commit is contained in:
@@ -667,6 +667,10 @@ func runSession(ctx context.Context, cancel context.CancelFunc, conn *websocket.
|
||||
if cfg.FetchPublicIP {
|
||||
hello.PublicIP = config.FetchPublicIPAddress()
|
||||
}
|
||||
if report, ok := loadPendingCrashReport(); ok {
|
||||
hello.LastCrashReason = report.Reason
|
||||
hello.LastCrashDetail = truncateStr(fmt.Sprintf("%s at %s", report.Detail, report.At), 1200)
|
||||
}
|
||||
|
||||
if err := wire.WriteMsg(ctx, env.Conn, hello); err != nil {
|
||||
return fmt.Errorf("send hello: %w", err)
|
||||
@@ -712,6 +716,9 @@ func runSession(ctx context.Context, cancel context.CancelFunc, conn *websocket.
|
||||
cancel()
|
||||
return fmt.Errorf("send initial ping: %w", err)
|
||||
}
|
||||
if hello.LastCrashReason != "" {
|
||||
clearPendingCrashReport()
|
||||
}
|
||||
|
||||
if interval := getPingInterval(); interval > 0 {
|
||||
log.Printf("ping: heartbeat interval=%s", interval)
|
||||
|
||||
Reference in New Issue
Block a user