Console: Better status feedback on manual reseed from URL

Reseed: Better status feedback and cleanup in summary bar
This commit is contained in:
zzz
2015-03-22 10:08:48 +00:00
parent 44c75187f5
commit 2c45378c6d
7 changed files with 79 additions and 24 deletions

View File

@@ -49,25 +49,23 @@ public class ConfigReseedHandler extends FormHandler {
addFormError(_("Reseeding is already in progress"));
} else {
// wait a while for completion but not forever
for (int i = 0; i < 20; i++) {
for (int i = 0; i < 40; i++) {
try {
Thread.sleep(1000);
Thread.sleep(500);
} catch (InterruptedException ie) {}
if (!_context.netDb().reseedChecker().inProgress()) {
String status = _context.netDb().reseedChecker().getStatus();
if (status.length() > 0)
addFormNotice(status);
else
addFormNotice(_("Ressed complete, check summary bar for status"));
return;
}
if (!_context.netDb().reseedChecker().inProgress())
break;
}
if (_context.netDb().reseedChecker().inProgress()) {
String status = _context.netDb().reseedChecker().getStatus();
if (status.length() > 0)
addFormNotice(status);
else
addFormNotice(_("Ressed in progress, check summary bar for status"));
String status = _context.netDb().reseedChecker().getStatus();
String error = _context.netDb().reseedChecker().getError();
if (error.length() > 0) {
addFormErrorNoEscape(error);
} else if (status.length() > 0) {
addFormNoticeNoEscape(status);
} else if (_context.netDb().reseedChecker().inProgress()) {
addFormNotice(_("Reseed in progress, check summary bar for status"));
} else {
addFormNotice(_("Reseed complete, check summary bar for status"));
}
}
} catch (IllegalArgumentException iae) {