* Enforce delay >= 1 in BlogManager.getUpdateDelay()
This commit is contained in:
@ -340,9 +340,13 @@ public class BlogManager {
|
|||||||
|
|
||||||
public String getDefaultProxyHost() { return _context.getProperty("syndie.defaultProxyHost", ""); }
|
public String getDefaultProxyHost() { return _context.getProperty("syndie.defaultProxyHost", ""); }
|
||||||
public String getDefaultProxyPort() { return _context.getProperty("syndie.defaultProxyPort", ""); }
|
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 String[] getUpdateArchives() { return _context.getProperty("syndie.updateArchives", "").split(","); }
|
||||||
public boolean getImportAddresses() { return _context.getProperty("syndie.importAddresses", "false").equals("true"); }
|
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) {
|
public boolean authorizeAdmin(String pass) {
|
||||||
if (isSingleUser()) return true;
|
if (isSingleUser()) return true;
|
||||||
|
@ -19,7 +19,6 @@ public class Updater {
|
|||||||
}
|
}
|
||||||
_lastUpdate = System.currentTimeMillis();
|
_lastUpdate = System.currentTimeMillis();
|
||||||
_log.debug("Update started.");
|
_log.debug("Update started.");
|
||||||
User user = new User();
|
|
||||||
String[] archives = bm.getUpdateArchives();
|
String[] archives = bm.getUpdateArchives();
|
||||||
for (int i = 0; i < archives.length; i++) {
|
for (int i = 0; i < archives.length; i++) {
|
||||||
fetchArchive(archives[i]);
|
fetchArchive(archives[i]);
|
||||||
@ -53,7 +52,6 @@ public class Updater {
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int delay = BlogManager.instance().getUpdateDelay();
|
int delay = BlogManager.instance().getUpdateDelay();
|
||||||
if (delay < 1) delay = 1;
|
|
||||||
update();
|
update();
|
||||||
try {
|
try {
|
||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
|
Reference in New Issue
Block a user