func start()

in server/cmd/async/start.go [45:65]


func start(cmd *cobra.Command, args []string) {
	logger := log.New(log.NewTextHandler(output, nil).WithAttrs(logattrs.GetAttrs()))
	if options.JsonLog {
		logger = log.New(log.NewJSONHandler(output, nil).WithAttrs(logattrs.GetAttrs()))
	}

	log.SetDefault(logger)
	ctx, cancel := context.WithCancel(context.Background())
	ctx = ctxlogger.WithLogger(ctx, logger)
	defer cancel()
	asyncStruct, err := async.NewAsync(ctx, options)
	if err != nil {
		logger.Error("Something went wrong starting async: " + err.Error())
		os.Exit(1)
	}

	err = asyncStruct.Processor.Start(ctx)
	if err != nil {
		logger.Error("Something went wrong starting processor.")
	}
}