Skip to content

Commit

Permalink
Merge pull request ACS-Community#19 in ALMA/almasw from ICT-8187-cdb_…
Browse files Browse the repository at this point in the history
…rdb-listeners-xml-references to master

Working

* commit 'd6d0c35e8e88a8a4428c8dcf3cad841c5bea6459':
  The regexp match lacked the ".*" at the end. Also fixed a small bug that wasn't removing a starting '/' in the curl.
  ICT-8187 fix manually gotten from https://svn.alma.cl/p2/branches/ICT-8187-TEMP/ACS/LGPL/CommonSoftware/cdb_rdb, which comes from the trunk
  • Loading branch information
normansaez committed Oct 23, 2017
2 parents 0fb0ce8 + 75b9270 commit f1f582d
Showing 1 changed file with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3482,6 +3482,7 @@ public void clear_cache(String curl) {
throw new NO_RESOURCES("load in progress");
}
curl = curl.replaceAll("/+","/");
String c = curl;
//Reload curl data from DB
if(curl.matches("/")) {
System.out.println("clear_cache_all()");
Expand All @@ -3496,8 +3497,8 @@ public void clear_cache(String curl) {
th.printStackTrace();
}
m_logger.info("clear_cache(curl): Main2");
String c = curl.replaceFirst("^/", "");
c = curl.replaceFirst("/$", "");
c = c.replaceFirst("^/", "");
c = c.replaceFirst("/$", "");
if (plugin != null) {
try {
Map<String, Object> rootMap = (Map<String, Object>) rootNode;
Expand All @@ -3517,7 +3518,7 @@ public void clear_cache(String curl) {
} else if (c.startsWith(COMPONENT_TREE_NAME)){
loadComponentsTree(c, true);
} else {
System.out.println("Unsupported curl: "+ curl);
System.out.println("Unsupported curl: "+ curl + ":" + c);
}
m_logger.info("clear_cache(curl): Main4");
if (plugin != null) {
Expand Down Expand Up @@ -3576,14 +3577,15 @@ public void clear_cache(String curl) {
synchronized (listenedCurls) {
Iterator iter = listenedCurls.keySet().iterator();
while (iter.hasNext()) {
String c = (String) iter.next();
curls.add(c);
String cl = (String) iter.next();
curls.add(cl);
}
}
m_logger.info("clear_cache(curl): Main8");

for (String c : curls)
clearCache(c);
for (String cl : curls)
if (cl.matches("^"+c+"/.*") || cl.matches("^"+c+"$"))
clearCache(cl);
m_logger.info("clear_cache(curl): Main9");
}

Expand Down

0 comments on commit f1f582d

Please sign in to comment.