From 01e06c0152c08fafdb5da2996bc42c13d6805bcd Mon Sep 17 00:00:00 2001 From: The Magician Date: Tue, 21 May 2024 14:31:20 +0100 Subject: [PATCH] Fix timestamp SELECT code --- sevenkeys/database/operations/selects.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sevenkeys/database/operations/selects.go b/sevenkeys/database/operations/selects.go index 651256a..e69a887 100644 --- a/sevenkeys/database/operations/selects.go +++ b/sevenkeys/database/operations/selects.go @@ -18,16 +18,16 @@ func GetGamepieceByName(db *sql.DB, name string) (entities.Gamepiece, error) { func GetCacheTimestampByType(db *sql.DB, cacheType string) (time.Time, error) { var timestamp string - query := "SELECT Stamp FROM CacheTimestamps WHERE CacheType = ?;" + query := "SELECT Stamp FROM CacheTimestamp WHERE CacheType = ?;" err := db.QueryRow(query, cacheType).Scan(×tamp) if err == sql.ErrNoRows { - return time.Unix(0, 0), nil + return time.Unix(0, 0), err } stamp, err := time.Parse("2006-01-02 15:04:05", timestamp) if err != nil { - return time.Unix(0, 0), nil + return time.Unix(0, 0), err } return stamp, err