MCPcopy
hub / github.com/PeerDB-io/peerdb / main

Function main

flow/main.go:26–320  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24)
25
26func main() {
27 appCtx, appClose := signal.NotifyContext(context.Background(), syscall.SIGINT, syscall.SIGTERM)
28 defer appClose()
29
30 slog.SetDefault(slog.New(shared.NewSlogHandler(slog.NewJSONHandler(os.Stdout, shared.NewSlogHandlerOptions()))))
31
32 temporalHostPortFlag := &cli.StringFlag{
33 Name: "temporal-host-port",
34 Value: "localhost:7233",
35 Sources: cli.EnvVars("TEMPORAL_HOST_PORT"),
36 }
37
38 profilingFlag := &cli.BoolFlag{
39 Name: "enable-profiling",
40 Value: false, // Default is off
41 Usage: "Enable profiling for the application",
42 Sources: cli.EnvVars("ENABLE_PROFILING"),
43 }
44 otelMetricsFlag := &cli.BoolFlag{
45 Name: "enable-otel-metrics",
46 Value: false, // Default is off
47 Usage: "Enable OpenTelemetry metrics for the application",
48 Sources: cli.EnvVars("ENABLE_OTEL_METRICS"),
49 }
50 otelTracesFlag := &cli.BoolFlag{
51 Name: "enable-otel-traces",
52 Value: false,
53 Usage: "Enable OpenTelemetry traces for the application",
54 Sources: cli.EnvVars("ENABLE_OTEL_TRACES"),
55 }
56
57 pprofPortFlag := &cli.Uint16Flag{
58 Name: "pprof-port",
59 Value: 6060,
60 Usage: "Port for pprof HTTP server",
61 Sources: cli.EnvVars("PPROF_PORT"),
62 }
63
64 temporalNamespaceFlag := &cli.StringFlag{
65 Name: "temporal-namespace",
66 Value: "default",
67 Usage: "Temporal namespace to use for workflow orchestration",
68 Sources: cli.EnvVars("PEERDB_TEMPORAL_NAMESPACE"),
69 }
70
71 temporalMaxConcurrentActivitiesFlag := &cli.IntFlag{
72 Name: "temporal-max-concurrent-activities",
73 Value: 1000,
74 Usage: "Temporal: maximum number of concurrent activities",
75 Sources: cli.EnvVars("TEMPORAL_MAX_CONCURRENT_ACTIVITIES"),
76 }
77
78 temporalMaxConcurrentWorkflowTasksFlag := &cli.IntFlag{
79 Name: "temporal-max-concurrent-workflow-tasks",
80 Value: 1000,
81 Usage: "Temporal: maximum number of concurrent workflows",
82 Sources: cli.EnvVars("TEMPORAL_MAX_CONCURRENT_WORKFLOW_TASKS"),
83 }

Callers

nothing calls this directly

Calls 4

ListenAndServeMethod · 0.95
RunMethod · 0.80
CloseMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected