Small improvement

pull/209/head
M66B 2 years ago
parent 7ef79410c5
commit df3b817b05

@ -597,6 +597,7 @@ class Core {
long attachments = (op.message == null ? 0 : db.attachment().countAttachments(op.message)); long attachments = (op.message == null ? 0 : db.attachment().countAttachments(op.message));
if (op.tries >= TOTAL_RETRY_MAX || if (op.tries >= TOTAL_RETRY_MAX ||
ex instanceof JSONException ||
ex instanceof OutOfMemoryError || ex instanceof OutOfMemoryError ||
ex instanceof FileNotFoundException || ex instanceof FileNotFoundException ||
ex instanceof FolderNotFoundException || ex instanceof FolderNotFoundException ||

@ -456,7 +456,7 @@ public class EntityRule {
boolean execute(Context context, EntityMessage message) throws JSONException { boolean execute(Context context, EntityMessage message) throws JSONException {
boolean executed = _execute(context, message); boolean executed = _execute(context, message);
if (id != null && executed) { if (this.id != null && executed) {
DB db = DB.getInstance(context); DB db = DB.getInstance(context);
db.rule().applyRule(id, new Date().getTime()); db.rule().applyRule(id, new Date().getTime());
} }
@ -744,9 +744,9 @@ public class EntityRule {
EntityOperation.queue(context, message, EntityOperation.RAW); EntityOperation.queue(context, message, EntityOperation.RAW);
} }
if (!complete) { if (!complete && this.id != null) {
EntityOperation.queue(context, message, EntityOperation.RULE, this.id); EntityOperation.queue(context, message, EntityOperation.RULE, this.id);
return false; return true;
} }
executor.submit(new Runnable() { executor.submit(new Runnable() {
@ -963,7 +963,7 @@ public class EntityRule {
if (message.ui_seen) if (message.ui_seen)
return false; return false;
if (!message.content) { if (!message.content && this.id != null) {
EntityOperation.queue(context, message, EntityOperation.BODY); EntityOperation.queue(context, message, EntityOperation.BODY);
EntityOperation.queue(context, message, EntityOperation.RULE, this.id); EntityOperation.queue(context, message, EntityOperation.RULE, this.id);
return true; return true;

Loading…
Cancel
Save