refactor: inject ConnectionManager into Worker
Pass ConnectionManager to Worker constructor to enable WebSocket broadcasting capabilities. Updated: - main.go: server initialization - test_helpers.go: test setup - commonhandlers.go: handler initialization This change enables Worker to broadcast job updates to connected clients.
This commit is contained in:
@@ -32,7 +32,7 @@ type Handler struct {
|
||||
|
||||
func NewHandler(db *database.Queries, connManager *wsync.ConnectionManager, queueProcessor *wsync.SyncQueueProcessor, cfg *config.Config) *Handler {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
worker := services.NewWorker(3)
|
||||
worker := services.NewWorker(3, connManager)
|
||||
|
||||
queueCtx, queueCancel := context.WithCancel(context.Background())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user