I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit 84383c3d authored by ragnarok's avatar ragnarok Committed by zzz
Browse files

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

parent a94abb13
No related branches found
No related tags found
No related merge requests found
...@@ -340,9 +340,13 @@ public class BlogManager { ...@@ -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 { ...@@ -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 { ...@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment