Fixed migration and added resend and cleanup options to demo application
This commit is contained in:
parent
409dccd0be
commit
725d2b848e
@ -281,7 +281,8 @@ public class BitmessageContext {
|
|||||||
|
|
||||||
public Property status() {
|
public Property status() {
|
||||||
return new Property("status", null,
|
return new Property("status", null,
|
||||||
ctx.getNetworkHandler().getNetworkStatus()
|
ctx.getNetworkHandler().getNetworkStatus(),
|
||||||
|
new Property("unacknowledged", ctx.getMessageRepository().findMessagesToResend().size())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,8 +118,27 @@ public class Application {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void info() {
|
private void info() {
|
||||||
|
String command;
|
||||||
|
do {
|
||||||
System.out.println();
|
System.out.println();
|
||||||
System.out.println(ctx.status());
|
System.out.println(ctx.status());
|
||||||
|
System.out.println();
|
||||||
|
System.out.println("c) cleanup inventory");
|
||||||
|
System.out.println("r) resend unacknowledged messages");
|
||||||
|
System.out.println(COMMAND_BACK);
|
||||||
|
|
||||||
|
command = commandLine.nextCommand();
|
||||||
|
switch (command) {
|
||||||
|
case "c":
|
||||||
|
ctx.cleanup();
|
||||||
|
break;
|
||||||
|
case "r":
|
||||||
|
ctx.resendUnacknowledgedMessages();
|
||||||
|
break;
|
||||||
|
case "b":
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} while (!"b".equals(command));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void identities() {
|
private void identities() {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
ALTER TABLE Message ADD COLUMN ack_data BINARY(32);
|
ALTER TABLE Message ADD COLUMN ack_data BINARY(32);
|
||||||
ALTER TABLE Message ADD COLUMN ttl BIGINT NOT NULL;
|
ALTER TABLE Message ADD COLUMN ttl BIGINT NOT NULL DEFAULT 0;
|
||||||
ALTER TABLE Message ADD COLUMN retries INT NOT NULL DEFAULT 0;
|
ALTER TABLE Message ADD COLUMN retries INT NOT NULL DEFAULT 0;
|
||||||
ALTER TABLE Message ADD COLUMN next_try BIGINT;
|
ALTER TABLE Message ADD COLUMN next_try BIGINT;
|
||||||
|
Loading…
Reference in New Issue
Block a user