feat: enable worker process
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-01-17 20:51:50 +01:00
parent a68eae8519
commit e94271d5e2
16 changed files with 404 additions and 19 deletions

View File

@@ -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)
}

View File

@@ -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()
);