mirror of https://github.com/apache/archiva.git
simplify code and better variable name
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1443526 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3e447d498c
commit
e0ecff38ea
|
@ -47,7 +47,7 @@ import java.util.concurrent.CopyOnWriteArrayList;
|
|||
* @author Olivier Lamy
|
||||
* @since 1.4-M2
|
||||
*/
|
||||
@Service( "indexMerger#default" )
|
||||
@Service("indexMerger#default")
|
||||
public class DefaultIndexMerger
|
||||
implements IndexMerger
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ public class DefaultIndexMerger
|
|||
|
||||
private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<TemporaryGroupIndex>();
|
||||
|
||||
private int defaultGroupIndexTtl;
|
||||
private int groupMergedIndexTtl;
|
||||
|
||||
@Inject
|
||||
public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
|
||||
|
@ -84,10 +84,7 @@ public class DefaultIndexMerger
|
|||
@PostConstruct
|
||||
public void intialize()
|
||||
{
|
||||
String ttlStr =
|
||||
System.getProperty( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, Integer.toString( DEFAULT_GROUP_INDEX_TTL ) );
|
||||
this.defaultGroupIndexTtl = NumberUtils.toInt( ttlStr, DEFAULT_GROUP_INDEX_TTL );
|
||||
|
||||
this.groupMergedIndexTtl = Integer.getInteger( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, DEFAULT_GROUP_INDEX_TTL );
|
||||
}
|
||||
|
||||
public IndexingContext buildMergedIndex( Collection<String> repositoriesIds, boolean packIndex )
|
||||
|
@ -169,6 +166,6 @@ public class DefaultIndexMerger
|
|||
|
||||
public int getGroupMergedIndexTtl()
|
||||
{
|
||||
return this.defaultGroupIndexTtl;
|
||||
return this.groupMergedIndexTtl;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,6 +87,7 @@ import org.codehaus.plexus.digest.Digester;
|
|||
import org.codehaus.plexus.digest.DigesterException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.slf4j.MarkerFactory;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
@ -108,7 +109,7 @@ import java.util.Set;
|
|||
/**
|
||||
*
|
||||
*/
|
||||
@Service ("davResourceFactory#archiva")
|
||||
@Service("davResourceFactory#archiva")
|
||||
public class ArchivaDavResourceFactory
|
||||
implements DavResourceFactory, Auditable
|
||||
{
|
||||
|
@ -139,7 +140,7 @@ public class ArchivaDavResourceFactory
|
|||
*
|
||||
*/
|
||||
@Inject
|
||||
@Named (value = "repositoryProxyConnectors#default")
|
||||
@Named(value = "repositoryProxyConnectors#default")
|
||||
private RepositoryProxyConnectors connectors;
|
||||
|
||||
/**
|
||||
|
@ -169,7 +170,7 @@ public class ArchivaDavResourceFactory
|
|||
*
|
||||
*/
|
||||
@Inject
|
||||
@Named (value = "httpAuthenticator#basic")
|
||||
@Named(value = "httpAuthenticator#basic")
|
||||
private HttpAuthenticator httpAuth;
|
||||
|
||||
@Inject
|
||||
|
@ -205,7 +206,7 @@ public class ArchivaDavResourceFactory
|
|||
*
|
||||
*/
|
||||
@Inject
|
||||
@Named (value = "archivaTaskScheduler#repository")
|
||||
@Named(value = "archivaTaskScheduler#repository")
|
||||
private RepositoryArchivaTaskScheduler scheduler;
|
||||
|
||||
private ApplicationContext applicationContext;
|
||||
|
@ -1181,11 +1182,14 @@ public class ArchivaDavResourceFactory
|
|||
if ( System.currentTimeMillis() - tmp.getCreationTime() > ( indexMerger.getGroupMergedIndexTtl() * 60
|
||||
* 1000 ) )
|
||||
{
|
||||
log.debug( "tmp group index is too old so delete it" );
|
||||
log.debug( MarkerFactory.getDetachedMarker( "group.merged.index" ),
|
||||
"tmp group index '{}' is too old so delete it", groupId );
|
||||
indexMerger.cleanTemporaryGroupIndex( tmp );
|
||||
}
|
||||
else
|
||||
{
|
||||
log.debug( MarkerFactory.getDetachedMarker( "group.merged.index" ),
|
||||
"merged index for group '{}' found in cache", groupId );
|
||||
return tmp.getDirectory();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue