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:
@@ -5,6 +5,7 @@ import (
|
||||
|
||||
"git.front.kjuulh.io/kjuulh/orbis/internal/executor"
|
||||
"git.front.kjuulh.io/kjuulh/orbis/internal/scheduler"
|
||||
"git.front.kjuulh.io/kjuulh/orbis/internal/worker"
|
||||
)
|
||||
|
||||
type App struct {
|
||||
@@ -28,3 +29,7 @@ func (a *App) Scheduler() *scheduler.Scheduler {
|
||||
func (a *App) Executor() *executor.Executor {
|
||||
return executor.NewExecutor(a.logger.With("component", "executor"))
|
||||
}
|
||||
|
||||
func (a *App) Worker() *worker.Worker {
|
||||
return worker.NewWorker(Postgres(), a.logger)
|
||||
}
|
||||
|
@@ -5,10 +5,10 @@ import (
|
||||
|
||||
"git.front.kjuulh.io/kjuulh/orbis/internal/persistence"
|
||||
"git.front.kjuulh.io/kjuulh/orbis/internal/utilities"
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
)
|
||||
|
||||
var Postgres = utilities.Singleton(func() (*pgx.Conn, error) {
|
||||
var Postgres = utilities.Singleton(func() (*pgxpool.Pool, error) {
|
||||
if err := persistence.Migrate(); err != nil {
|
||||
return nil, fmt.Errorf("failed to migrate database: %w", err)
|
||||
}
|
||||
|
Reference in New Issue
Block a user