From fdba89ae2f5b0c732027035a14345e62545979d7 Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 4 Dec 2024 15:09:55 +0100 Subject: [PATCH] stores: set pricetable and expiry on success --- stores/sql/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stores/sql/main.go b/stores/sql/main.go index f80a3c57f..c9d4f60e0 100644 --- a/stores/sql/main.go +++ b/stores/sql/main.go @@ -1630,8 +1630,8 @@ func RecordHostScans(ctx context.Context, tx sql.Tx, scans []api.HostScan) error last_scan = ?, settings = CASE WHEN ? THEN ? ELSE settings END, v2_settings = CASE WHEN ? THEN ? ELSE settings END, - price_table = CASE WHEN ? AND (price_table_expiry IS NULL OR ? > price_table_expiry) THEN ? ELSE price_table END, - price_table_expiry = CASE WHEN ? AND (price_table_expiry IS NULL OR ? > price_table_expiry) THEN ? ELSE price_table_expiry END, + price_table = CASE WHEN ? THEN ? ELSE price_table END, + price_table_expiry = CASE WHEN ? THEN ? ELSE price_table_expiry END, successful_interactions = CASE WHEN ? THEN successful_interactions + 1 ELSE successful_interactions END, failed_interactions = CASE WHEN ? THEN failed_interactions + 1 ELSE failed_interactions END WHERE public_key = ?