pi-better-goal 0.16.2 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/assignment-inbox.mjs
CHANGED
|
@@ -106,6 +106,10 @@ export class AssignmentInbox {
|
|
|
106
106
|
this.db.exec(this.shared ? `RELEASE ${this.alias}_ack` : "COMMIT");
|
|
107
107
|
} catch (error) { this.db.exec(this.shared ? `ROLLBACK TO ${this.alias}_ack; RELEASE ${this.alias}_ack` : "ROLLBACK"); throw error; }
|
|
108
108
|
}
|
|
109
|
+
get hasPendingChanges() {
|
|
110
|
+
return Boolean(this.more || this.db.prepare(`SELECT 1 FROM ${this.prefix}pending LIMIT 1`).get());
|
|
111
|
+
}
|
|
112
|
+
|
|
109
113
|
get metrics() {
|
|
110
114
|
const pending = this.db.prepare(`SELECT count(*) AS pending, min(since) AS oldestPendingAt FROM ${this.prefix}pending`).get();
|
|
111
115
|
return { ...this.db.prepare(`SELECT * FROM ${this.prefix}position`).get(),
|
|
@@ -90,6 +90,7 @@ export function createAssignmentReader(path, inboxPath = ":memory:", derivedConn
|
|
|
90
90
|
connection(refresh = true) { if (refresh) this.revision(); return db; },
|
|
91
91
|
changes() { this.revision(); return inbox.receive(db, identity); },
|
|
92
92
|
acknowledgeChanges(batch, complete) { inbox.acknowledge(batch, complete); },
|
|
93
|
+
get hasPendingChanges() { return inbox.hasPendingChanges; },
|
|
93
94
|
get changeMetrics() { return inbox.metrics; },
|
|
94
95
|
get snapshotActive() { return snapshot; },
|
|
95
96
|
|