Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
22a7f0099
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Summer2022
22a7f0099
Commits
d7cc3afa
Commit
d7cc3afa
authored
5 years ago
by
fangyincheng
Browse files
Options
Downloads
Patches
Plain Diff
Fix: reviews
parent
17c29b5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
config/config_loader.go
+26
-26
26 additions, 26 deletions
config/config_loader.go
with
26 additions
and
26 deletions
config/config_loader.go
+
26
−
26
View file @
d7cc3afa
...
...
@@ -81,32 +81,6 @@ func checkApplicationName(config *ApplicationConfig) {
// Load Dubbo Init
func
Load
()
{
// init other consumer config
conConfigType
:=
consumerConfig
.
ConfigType
for
key
,
value
:=
range
extension
.
GetDefaultConfitReader
()
{
if
conConfigType
==
nil
{
if
v
,
ok
:=
conConfigType
[
key
];
ok
{
value
=
v
}
}
if
err
:=
extension
.
GetConfigReaders
(
value
)
.
ReadConsumerConfig
(
consumerConfig
.
fileStream
);
err
!=
nil
{
logger
.
Errorf
(
"ReadConsumerConfig error: %#v for %s"
,
perrors
.
WithStack
(
err
),
value
)
}
}
// init other provider config
proConfigType
:=
providerConfig
.
ConfigType
for
key
,
value
:=
range
extension
.
GetDefaultConfitReader
()
{
if
proConfigType
!=
nil
{
if
v
,
ok
:=
proConfigType
[
key
];
ok
{
value
=
v
}
}
if
err
:=
extension
.
GetConfigReaders
(
value
)
.
ReadProviderConfig
(
providerConfig
.
fileStream
);
err
!=
nil
{
logger
.
Errorf
(
"ReadProviderConfig error: %#v for %s"
,
perrors
.
WithStack
(
err
),
value
)
}
}
// init router
if
confRouterFile
!=
""
{
if
errPro
:=
RouterInit
(
confRouterFile
);
errPro
!=
nil
{
...
...
@@ -118,6 +92,19 @@ func Load() {
if
consumerConfig
==
nil
{
logger
.
Warnf
(
"consumerConfig is nil!"
)
}
else
{
// init other consumer config
conConfigType
:=
consumerConfig
.
ConfigType
for
key
,
value
:=
range
extension
.
GetDefaultConfitReader
()
{
if
conConfigType
==
nil
{
if
v
,
ok
:=
conConfigType
[
key
];
ok
{
value
=
v
}
}
if
err
:=
extension
.
GetConfigReaders
(
value
)
.
ReadConsumerConfig
(
consumerConfig
.
fileStream
);
err
!=
nil
{
logger
.
Errorf
(
"ReadConsumerConfig error: %#v for %s"
,
perrors
.
WithStack
(
err
),
value
)
}
}
metricConfig
=
consumerConfig
.
MetricConfig
applicationConfig
=
consumerConfig
.
ApplicationConfig
...
...
@@ -178,6 +165,19 @@ func Load() {
if
providerConfig
==
nil
{
logger
.
Warnf
(
"providerConfig is nil!"
)
}
else
{
// init other provider config
proConfigType
:=
providerConfig
.
ConfigType
for
key
,
value
:=
range
extension
.
GetDefaultConfitReader
()
{
if
proConfigType
!=
nil
{
if
v
,
ok
:=
proConfigType
[
key
];
ok
{
value
=
v
}
}
if
err
:=
extension
.
GetConfigReaders
(
value
)
.
ReadProviderConfig
(
providerConfig
.
fileStream
);
err
!=
nil
{
logger
.
Errorf
(
"ReadProviderConfig error: %#v for %s"
,
perrors
.
WithStack
(
err
),
value
)
}
}
// so, you should know that the consumer's config will be override
metricConfig
=
providerConfig
.
MetricConfig
applicationConfig
=
providerConfig
.
ApplicationConfig
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment