parent
9ecf742360
commit
89f6c0a13a
|
@ -41,6 +41,8 @@ type NewLeadWorkflowWrapper struct {
|
||||||
|
|
||||||
// NewLeadWorkflow is a Temporal workflow
|
// NewLeadWorkflow is a Temporal workflow
|
||||||
func NewLeadWorkflow(ctx temporal_workflow.Context, w NewLeadWorkflowWrapper) error { //nolint:gocritic // don't care
|
func NewLeadWorkflow(ctx temporal_workflow.Context, w NewLeadWorkflowWrapper) error { //nolint:gocritic // don't care
|
||||||
|
sugar.Info("rules.NewLeadWorkflow: 📥")
|
||||||
|
sugar.Debugf("rules.NewLeadWorkflow: wrapper: %v", w)
|
||||||
transferDetails := app.LeadActivityWrapper{
|
transferDetails := app.LeadActivityWrapper{
|
||||||
// Address: w.Address,
|
// Address: w.Address,
|
||||||
Company: w.Company,
|
Company: w.Company,
|
||||||
|
@ -76,13 +78,17 @@ func NewLeadWorkflow(ctx temporal_workflow.Context, w NewLeadWorkflowWrapper) er
|
||||||
RetryPolicy: retryPolicy,
|
RetryPolicy: retryPolicy,
|
||||||
}
|
}
|
||||||
ctx = temporal_workflow.WithActivityOptions(ctx, options)
|
ctx = temporal_workflow.WithActivityOptions(ctx, options)
|
||||||
|
sugar.Debugf("rules.NewLeadWorkflow: ctx: %v", ctx)
|
||||||
|
sugar.Debugf("rules.NewLeadWorkflow: 📏 do Store", ctx)
|
||||||
err := temporal_workflow.ExecuteActivity(ctx, StoreLeadActivity, transferDetails).Get(ctx, nil)
|
err := temporal_workflow.ExecuteActivity(ctx, StoreLeadActivity, transferDetails).Get(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
sugar.Debugf("rules.NewLeadWorkflow: 📏 do Notify", ctx)
|
||||||
err = temporal_workflow.ExecuteActivity(ctx, NotifyLeadActivity, transferDetails).Get(ctx, nil)
|
err = temporal_workflow.ExecuteActivity(ctx, NotifyLeadActivity, transferDetails).Get(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
sugar.Info("rules.NewLeadWorkflow: 👍 📤")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ const getTimeout = 6 * time.Minute
|
||||||
const postTimeout = 6 * time.Minute
|
const postTimeout = 6 * time.Minute
|
||||||
const maxAttempts = 50
|
const maxAttempts = 50
|
||||||
|
|
||||||
var sugar = logger.New(zapcore.InfoLevel)
|
var sugar = logger.New(zapcore.DebugLevel)
|
||||||
|
|
||||||
var crmClient = crm_client.Default
|
var crmClient = crm_client.Default
|
||||||
var devopsClient = devops_client.Default
|
var devopsClient = devops_client.Default
|
||||||
|
|
Loading…
Reference in New Issue