This commit is contained in:
Fabio Sinibaldi 2017-01-25 16:14:28 +00:00
parent f58eb5f7d8
commit b5aa06aa3e
1 changed files with 10 additions and 6 deletions

View File

@ -429,9 +429,11 @@ public class GeoNetwork implements GeoNetworkAdministration {
do{ do{
try{Thread.sleep(wait);}catch(InterruptedException e){} try{Thread.sleep(wait);}catch(InterruptedException e){}
created=GroupUtils.getByName(getClient().getGroups(), name); created=GroupUtils.getByName(getClient().getGroups(), name);
}while(created==null && (System.currentTimeMillis()-submitTime<=timeout)); }while(created==null && (System.currentTimeMillis()-submitTime>=timeout));
log.error("GN Update timeout {}ms reached. Group [ID : {}, name : {} ] not created.",timeout,id,name); if(created==null) {
if(created==null) throw new GNServerException("Reached timeout while creating group with id "+id); log.error("GN Update timeout {}ms reached. Group [ID : {}, name : {} ] not created.",timeout,id,name);
throw new GNServerException("Reached timeout while creating group with id "+id);
}
return created; return created;
} }
@ -489,9 +491,11 @@ public class GeoNetwork implements GeoNetworkAdministration {
do{ do{
try{Thread.sleep(wait);}catch(InterruptedException e){} try{Thread.sleep(wait);}catch(InterruptedException e){}
created=UserUtils.getByName(getClient().getUsers(), username); created=UserUtils.getByName(getClient().getUsers(), username);
}while(created==null && (System.currentTimeMillis()-submitTime<=timeout)); }while(created==null && (System.currentTimeMillis()-submitTime>=timeout));
log.error("GN Update timeout {}ms reached. User {} not created.",timeout,username); if(created==null) {
if(created==null) throw new GNServerException("Reached timeout while creating user "+username); log.error("GN Update timeout {}ms reached. User {} not created.",timeout,username);
throw new GNServerException("Reached timeout while creating user "+username);
}
return created; return created;
} }