Skip to content

Commit 90f5441

Browse files
authored
Merge pull request #1 from kfiravr2/kfiravr2-patch-1
Memory-leak fix
2 parents 35b2bb7 + 7f1e0cc commit 90f5441

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

storage/uniqueNugetDeploy/uniqueNugetDeploy.groovy

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ try {
3737
ngas = org.artifactory.addon.nuget.repomd.NuGetArtifactoryService.class
3838
} catch (MissingPropertyException ex) {}
3939

40+
def cpath = "plugins/uniqueNugetDeploy.properties"
41+
def cfile = new File(ctx.artifactoryHome.haAwareEtcDir, cpath)
42+
def config = new ConfigSlurper().parse(cfile.toURL())
43+
44+
4045
class FakeUriInfo implements UriInfo {
4146
MultivaluedMap<String,String> ps;
4247
public FakeUriInfo(MultivaluedMap<String,String> ps) {this.ps = ps}
@@ -63,9 +68,6 @@ class FakeUriInfo implements UriInfo {
6368

6469
storage {
6570
beforeCreate { item ->
66-
def cpath = "plugins/uniqueNugetDeploy.properties"
67-
def cfile = new File(ctx.artifactoryHome.haAwareEtcDir, cpath)
68-
def config = new ConfigSlurper().parse(cfile.toURL())
6971
def repoKeys = config.checkedRepos as String[]
7072
def filtKeys = config.filteredRepos as String[]
7173
if (!item || !(item.repoKey in filtKeys)) return
@@ -98,7 +100,12 @@ storage {
98100
} catch (MissingPropertyException ex) {}
99101
if (ngsps4 != null) {
100102
def params = [ps4] as Object[]
101-
context.nuGetSearchParameters = ngsps4.newInstance(params)
103+
try {
104+
context.nuGetSearchParameters = ngsps4.newInstance(params)
105+
} catch (GroovyRuntimeException e) {
106+
params = [ps4, true] as Object[]
107+
context.nuGetSearchParameters = ngsps4.newInstance(params)
108+
}
102109
} else {
103110
def params = [ps3, ''] as Object[]
104111
context.nuGetSearchParameters = ngsps3.newInstance(params)

0 commit comments

Comments
 (0)