mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-18 03:01:05 +01:00
check RepoId in InMemoryConfigurationStoreFactory
This commit is contained in:
@@ -56,10 +56,15 @@ public class InMemoryConfigurationStoreFactory implements ConfigurationStoreFact
|
|||||||
@Override
|
@Override
|
||||||
public ConfigurationStore getStore(TypedStoreParameters storeParameters) {
|
public ConfigurationStore getStore(TypedStoreParameters storeParameters) {
|
||||||
String name = storeParameters.getName();
|
String name = storeParameters.getName();
|
||||||
return get(name);
|
String id = storeParameters.getRepositoryId();
|
||||||
|
return get(name, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationStore get(String name) {
|
public ConfigurationStore get(String name, String id) {
|
||||||
return stores.computeIfAbsent(name, x -> new InMemoryConfigurationStore());
|
return stores.computeIfAbsent(buildKey(name, id), x -> new InMemoryConfigurationStore());
|
||||||
|
}
|
||||||
|
|
||||||
|
private String buildKey(String name, String id) {
|
||||||
|
return id == null? name: name + "-" + id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user