[Apt-got-cvs-commits] apt-got/src/com/debianmirror/mirror/data DebianMirror.java,1.5,1.6
Status: Beta
Brought to you by:
dun3
From: Tobias H. <du...@bt...> - 2004-06-01 19:41:58
|
Update of /var/lib/cvs/apt-got/apt-got/src/com/debianmirror/mirror/data In directory btfmx2:/tmp/cvs-serv13587/src/com/debianmirror/mirror/data Modified Files: DebianMirror.java Log Message: Now the refreshing mechanism starts every 24 hours or if you state /trigger/new_package_lists after your module URL (eg http://localhost/debian/trigger/new_package_lists). Index: DebianMirror.java =================================================================== RCS file: /var/lib/cvs/apt-got/apt-got/src/com/debianmirror/mirror/data/DebianMirror.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** DebianMirror.java 1 Jun 2004 19:05:16 -0000 1.5 --- DebianMirror.java 1 Jun 2004 19:41:48 -0000 1.6 *************** *** 11,14 **** --- 11,15 ---- import java.util.logging.Logger; import java.util.logging.Level; + import java.util.Date; import com.debianmirror.http.HttpSubDirFinder; import com.debianmirror.util.CollectionHelper; *************** *** 34,41 **** --- 35,45 ---- private LinkedList _newLists; + private Date _nextUpdate; + public DebianMirror(DebianMirrorFilePool dmfp, String remoteURL) throws IOException { _state = INITIALIZING; _stateLock = new Object(); _filePool = dmfp; + _nextUpdate = new Date(); _remoteURL = new URL(remoteURL); _logger = _filePool.getLogger(); *************** *** 61,64 **** --- 65,70 ---- _stateLock.notifyAll(); } + // set next update + _nextUpdate = new Date((new Date()).getTime() + 24*60*60*1000); while(true) { synchronized(this) { *************** *** 68,71 **** --- 74,82 ---- } // implement maintenance + if((new Date()).after(_nextUpdate)) { + _logger.info("Starting next updating cycle"); + _nextUpdate = new Date((new Date()).getTime() + 24*60*60*1000); + _stateChangePossible = true; + } if(_stateChangePossible) { _stateChangePossible = false; |