feat: enable worker process
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,14 +6,14 @@ import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
func NewConnection() (*pgx.Conn, error) {
|
||||
func NewConnection() (*pgxpool.Pool, error) {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
|
||||
defer cancel()
|
||||
|
||||
conn, err := pgx.Connect(ctx, os.Getenv("ORBIS_POSTGRES_DB"))
|
||||
conn, err := pgxpool.New(ctx, os.Getenv("ORBIS_POSTGRES_DB"))
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to connect to orbis postgres database: %w", err)
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
CREATE TABLE test_table (
|
||||
id UUID primary key not null
|
||||
CREATE TABLE worker_register (
|
||||
worker_id UUID PRIMARY KEY NOT NULL
|
||||
, heart_beat TIMESTAMPTZ NOT NULL DEFAULT now()
|
||||
);
|
||||
|
Reference in New Issue
Block a user