Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
apollo
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
apollo
Commits
00723403
Commit
00723403
authored
Aug 08, 2018
by
nobodyiam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix the situation when some public app namespace is deleted and recreated in another app
parent
59660027
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
1 deletion
+11
-1
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/AppNamespaceService.java
...rip/framework/apollo/biz/service/AppNamespaceService.java
+6
-0
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCache.java
...o/configservice/service/AppNamespaceServiceWithCache.java
+5
-1
No files found.
apollo-biz/src/main/java/com/ctrip/framework/apollo/biz/service/AppNamespaceService.java
View file @
00723403
...
@@ -131,6 +131,12 @@ public class AppNamespaceService {
...
@@ -131,6 +131,12 @@ public class AppNamespaceService {
List
<
Cluster
>
clusters
=
clusterService
.
findParentClusters
(
appId
);
List
<
Cluster
>
clusters
=
clusterService
.
findParentClusters
(
appId
);
for
(
Cluster
cluster
:
clusters
)
{
for
(
Cluster
cluster
:
clusters
)
{
// in case there is some dirty data, e.g. public namespace deleted in other app and now created in this app
if
(!
namespaceService
.
isNamespaceUnique
(
appId
,
cluster
.
getName
(),
namespaceName
))
{
continue
;
}
Namespace
namespace
=
new
Namespace
();
Namespace
namespace
=
new
Namespace
();
namespace
.
setClusterName
(
cluster
.
getName
());
namespace
.
setClusterName
(
cluster
.
getName
());
namespace
.
setAppId
(
appId
);
namespace
.
setAppId
(
appId
);
...
...
apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/AppNamespaceServiceWithCache.java
View file @
00723403
...
@@ -247,8 +247,12 @@ public class AppNamespaceServiceWithCache implements InitializingBean {
...
@@ -247,8 +247,12 @@ public class AppNamespaceServiceWithCache implements InitializingBean {
}
}
appNamespaceCache
.
remove
(
assembleAppNamespaceKey
(
deleted
));
appNamespaceCache
.
remove
(
assembleAppNamespaceKey
(
deleted
));
if
(
deleted
.
isPublic
())
{
if
(
deleted
.
isPublic
())
{
AppNamespace
publicAppNamespace
=
publicAppNamespaceCache
.
get
(
deleted
.
getName
());
// in case there is some dirty data, e.g. public namespace deleted in some app and now created in another app
if
(
publicAppNamespace
==
deleted
)
{
publicAppNamespaceCache
.
remove
(
deleted
.
getName
());
publicAppNamespaceCache
.
remove
(
deleted
.
getName
());
}
}
}
logger
.
info
(
"Found AppNamespace deleted, {}"
,
deleted
);
logger
.
info
(
"Found AppNamespace deleted, {}"
,
deleted
);
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment