@@ -39,10 +39,10 @@ var (
39
39
fixDBConnDisableMutex bool
40
40
fixRouteWorkerPoolSize int
41
41
42
- fixCustomerPort int
43
- fixDriverPort int
44
- fixFrontendPort int
45
- fixRoutePort int
42
+ customerPort int
43
+ driverPort int
44
+ frontendPort int
45
+ routePort int
46
46
)
47
47
48
48
// RootCmd represents the base command when called without any subcommands
@@ -69,10 +69,10 @@ func init() {
69
69
RootCmd .PersistentFlags ().IntVarP (& fixRouteWorkerPoolSize , "fix-route-worker-pool-size" , "W" , 3 , "Default worker pool size" )
70
70
71
71
// Add flags to choose ports for services
72
- RootCmd .PersistentFlags ().IntVarP (& fixCustomerPort , "set- customer-service-port" , "c" , 8081 , "Set port for customer service" )
73
- RootCmd .PersistentFlags ().IntVarP (& fixDriverPort , "set- driver-service-port" , "d" , 8082 , "Set port for driver service" )
74
- RootCmd .PersistentFlags ().IntVarP (& fixFrontendPort , "set- frontend-service-port" , "f" , 8080 , "Set port for frontend service" )
75
- RootCmd .PersistentFlags ().IntVarP (& fixRoutePort , "set- route-service-port" , "r" , 8083 , "Set port for routing service" )
72
+ RootCmd .PersistentFlags ().IntVarP (& customerPort , "customer-service-port" , "c" , 8081 , "Port for customer service" )
73
+ RootCmd .PersistentFlags ().IntVarP (& driverPort , "driver-service-port" , "d" , 8082 , "Port for driver service" )
74
+ RootCmd .PersistentFlags ().IntVarP (& frontendPort , "frontend-service-port" , "f" , 8080 , "Port for frontend service" )
75
+ RootCmd .PersistentFlags ().IntVarP (& routePort , "route-service-port" , "r" , 8083 , "Port for routing service" )
76
76
77
77
rand .Seed (int64 (time .Now ().Nanosecond ()))
78
78
logger , _ = zap .NewDevelopment (zap .AddStacktrace (zapcore .FatalLevel ))
@@ -103,24 +103,24 @@ func onInitialize() {
103
103
config .RouteWorkerPoolSize = fixRouteWorkerPoolSize
104
104
}
105
105
106
- if config .CustomerPort != fixCustomerPort {
107
- logger .Info ("fix: changing customer service port" , zap .Int ("old" , config .CustomerPort ), zap .Int ("new" , fixCustomerPort ))
108
- config .CustomerPort = fixCustomerPort
106
+ if config .CustomerPort != customerPort {
107
+ logger .Info ("changing customer service port" , zap .Int ("old" , config .CustomerPort ), zap .Int ("new" , customerPort ))
108
+ config .CustomerPort = customerPort
109
109
}
110
110
111
- if config .DriverPort != fixDriverPort {
112
- logger .Info ("fix: changing driver service port" , zap .Int ("old" , config .DriverPort ), zap .Int ("new" , fixDriverPort ))
113
- config .DriverPort = fixDriverPort
111
+ if config .DriverPort != driverPort {
112
+ logger .Info ("changing driver service port" , zap .Int ("old" , config .DriverPort ), zap .Int ("new" , driverPort ))
113
+ config .DriverPort = driverPort
114
114
}
115
115
116
- if config .FrontendPort != fixFrontendPort {
117
- logger .Info ("fix: changing frontend service port" , zap .Int ("old" , config .FrontendPort ), zap .Int ("new" , fixFrontendPort ))
118
- config .FrontendPort = fixFrontendPort
116
+ if config .FrontendPort != frontendPort {
117
+ logger .Info ("changing frontend service port" , zap .Int ("old" , config .FrontendPort ), zap .Int ("new" , frontendPort ))
118
+ config .FrontendPort = frontendPort
119
119
}
120
120
121
121
if config .RoutePort != fixRoutePort {
122
- logger .Info ("fix: changing route service port" , zap .Int ("old" , config .RoutePort ), zap .Int ("new" , fixRoutePort ))
123
- config .RoutePort = fixRoutePort
122
+ logger .Info ("changing route service port" , zap .Int ("old" , config .RoutePort ), zap .Int ("new" , fixRoutePort ))
123
+ config .RoutePort = routePort
124
124
}
125
125
}
126
126
0 commit comments