From a2a2d008dddc6c526c22d7a7c4ec14dc2f9fca97 Mon Sep 17 00:00:00 2001 From: Kenneth Date: Tue, 13 May 2025 00:51:22 +0100 Subject: [PATCH] fix sql conflict on summary cache update --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 880df92..14e2090 100644 --- a/main.go +++ b/main.go @@ -703,7 +703,7 @@ func updateSummary(ctx context.Context, state *state, opts updateSummaryOptions) summary := result.Text() - _, err = state.db.ExecContext(ctx, "INSERT INTO summaries (location, summary) VALUES (?, ?)", locKey, summary) + _, err = state.db.ExecContext(ctx, "INSERT OR REPLACE INTO summaries (location, summary) VALUES (?, ?)", locKey, summary) if err != nil { slog.Warn("unable to cache generated weather summary to db", "location", locKey, "error", err) }