* Enforce delay >= 1 in BlogManager.getUpdateDelay()

This commit is contained in:
ragnarok
2005-10-25 01:24:32 +00:00
committed by zzz
parent a94abb13a4
commit 84383c3dab
2 changed files with 5 additions and 3 deletions

View File

@ -340,9 +340,13 @@ public class BlogManager {
public String getDefaultProxyHost() { return _context.getProperty("syndie.defaultProxyHost", ""); }
public String getDefaultProxyPort() { return _context.getProperty("syndie.defaultProxyPort", ""); }
public int getUpdateDelay() { return Integer.parseInt(_context.getProperty("syndie.updateDelay", "12")); }
public String[] getUpdateArchives() { return _context.getProperty("syndie.updateArchives", "").split(","); }
public boolean getImportAddresses() { return _context.getProperty("syndie.importAddresses", "false").equals("true"); }
public int getUpdateDelay() {
int delay = Integer.parseInt(_context.getProperty("syndie.updateDelay", "12"));
if (delay < 1) delay = 1;
return delay;
}
public boolean authorizeAdmin(String pass) {
if (isSingleUser()) return true;

View File

@ -19,7 +19,6 @@ public class Updater {
}
_lastUpdate = System.currentTimeMillis();
_log.debug("Update started.");
User user = new User();
String[] archives = bm.getUpdateArchives();
for (int i = 0; i < archives.length; i++) {
fetchArchive(archives[i]);
@ -53,7 +52,6 @@ public class Updater {
while (true) {
int delay = BlogManager.instance().getUpdateDelay();
if (delay < 1) delay = 1;
update();
try {
synchronized (this) {