From 7ae0651a55ace3c5d1f651775c1160f6e0b72152 Mon Sep 17 00:00:00 2001 From: Jonas Knobloch Date: Sun, 7 Jun 2026 20:26:59 +0200 Subject: Add config to lesci experiment --- research/lesci/context.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'research/lesci/context.go') diff --git a/research/lesci/context.go b/research/lesci/context.go index df9b059..8496507 100644 --- a/research/lesci/context.go +++ b/research/lesci/context.go @@ -1,6 +1,7 @@ package lesci import ( + "context" "database/sql" "database/sql/driver" "fmt" @@ -39,7 +40,17 @@ func (e *Experiment) BuildContext(db *sql.DB) error { } else if !ok { fmt.Println("context table not empty") - return nil + if !e.options.ForceContext { + fmt.Println("skipping context collection") + + return nil + } + + fmt.Println("clearing context") + + if _, err := db.ExecContext(context.Background(), `DELETE FROM context`); err != nil { + return err + } } return AppendRows(db, "context", func(append AppendFunc) error { -- cgit v1.3.1