diff options
author | Gibheer <gibheer+git@zero-knowledge.org> | 2024-09-05 19:38:25 +0200 |
---|---|---|
committer | Gibheer <gibheer+git@zero-knowledge.org> | 2024-09-05 19:38:25 +0200 |
commit | 6ea4d2c82de80efc87708e5e182034b7c6c2019e (patch) | |
tree | 35c0856a929040216c82153ca62d43b27530a887 /cmd/monwork/main.go | |
parent | 6f64eeace1b66639b9380b44e88a8d54850a4306 (diff) |
lib/pq is out of maintenance for some time now, so switch to the newer
more active library. Looks like it finally stabilized after a long time.
Diffstat (limited to 'cmd/monwork/main.go')
-rw-r--r-- | cmd/monwork/main.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd/monwork/main.go b/cmd/monwork/main.go index 4271213..1e8d69f 100644 --- a/cmd/monwork/main.go +++ b/cmd/monwork/main.go @@ -11,7 +11,7 @@ import ( "text/template" "time" - "github.com/lib/pq" + _ "github.com/jackc/pgx/v5/stdlib" ) var ( @@ -42,7 +42,7 @@ func main() { log.Fatalf("could not parse check interval: %s", err) } - db, err := sql.Open("postgres", config.DB) + db, err := sql.Open("pgx", config.DB) if err != nil { log.Fatalf("could not open database connection: %s", err) } @@ -167,7 +167,7 @@ func startConfigGen(db *sql.DB, checkInterval time.Duration) { time.Sleep(checkInterval) continue } - if _, err := tx.Exec(SQLRefreshActiveCheck, check_id, pq.Array(stringToShellFields(cmd.Bytes()))); err != nil { + if _, err := tx.Exec(SQLRefreshActiveCheck, check_id, stringToShellFields(cmd.Bytes())); err != nil { tx.Rollback() log.Printf("could not refresh check '%d': %s", check_id, err) continue |