feat: adapt new logging to workflow node processors

This commit is contained in:
Fu Diwei
2025-03-17 22:50:25 +08:00
parent b620052b88
commit af5d7465a1
22 changed files with 714 additions and 274 deletions

View File

@@ -32,7 +32,7 @@ type WorkflowService struct {
func NewWorkflowService(workflowRepo workflowRepository, workflowRunRepo workflowRunRepository) *WorkflowService {
srv := &WorkflowService{
dispatcher: dispatcher.GetSingletonDispatcher(workflowRepo, workflowRunRepo),
dispatcher: dispatcher.GetSingletonDispatcher(),
workflowRepo: workflowRepo,
workflowRunRepo: workflowRunRepo,
@@ -83,6 +83,7 @@ func (s *WorkflowService) StartRun(ctx context.Context, req *dtos.WorkflowStartR
Status: domain.WorkflowRunStatusTypePending,
Trigger: req.RunTrigger,
StartedAt: time.Now(),
Detail: workflow.Content,
}
if resp, err := s.workflowRunRepo.Save(ctx, run); err != nil {
return err
@@ -91,8 +92,8 @@ func (s *WorkflowService) StartRun(ctx context.Context, req *dtos.WorkflowStartR
}
s.dispatcher.Dispatch(&dispatcher.WorkflowWorkerData{
WorkflowId: workflow.Id,
WorkflowContent: workflow.Content,
WorkflowId: run.WorkflowId,
WorkflowContent: run.Detail,
RunId: run.Id,
})