handle context cancelation

This commit is contained in:
2025-11-13 16:05:16 +00:00
parent 54fced39aa
commit f3d0f5d71a
7 changed files with 50 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
package internal
import (
"context"
"fmt"
"io"
"os"
@@ -24,7 +25,7 @@ func NewReportLogger(w io.Writer) *ReportLogger {
}
}
func (rl *ReportLogger) Write(ri ReportItem) error {
func (rl *ReportLogger) Write(_ context.Context, ri ReportItem) error {
rl.counter++
_, err := fmt.Fprintf(rl.writer, "%6d - realised %+f on %s\n", rl.counter, ri.RealisedPnL(), ri.SellTimestamp.Format(time.RFC3339))
return err