From 1d0d1aa20fde466c9b8ba8bdd361dc08a81f0d20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sat, 10 Apr 2021 09:33:11 +0200 Subject: [PATCH] Fix error in postgres store --- honeypot/store/postgres.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/honeypot/store/postgres.go b/honeypot/store/postgres.go index e0e7e46..d4ed193 100644 --- a/honeypot/store/postgres.go +++ b/honeypot/store/postgres.go @@ -57,18 +57,13 @@ RETURNING id;` return err } l.ID = id - return nil + return tx.Commit() } func (s *PostgresStore) All() ([]models.LoginAttempt, error) { stmt := `SELECT date, remote_ip, username, password, client_version, connection_uuid, country FROM login_attempts` - tx, err := s.db.Begin() - if err != nil { - return nil, err - } - - rows, err := tx.Query(stmt) + rows, err := s.db.Query(stmt) if err != nil { return nil, err }