reduced logging
This commit is contained in:
parent
e24be625d1
commit
8ce984151b
|
@ -66,7 +66,6 @@ export class Collection {
|
|||
eventType = 'create';
|
||||
}
|
||||
const deltaBulider = new EntityPropertiesDeltaBuilder(entityId);
|
||||
console.log('deltaBulider -->', deltaBulider.delta);
|
||||
|
||||
if (!properties) {
|
||||
// Let's interpret this as entity deletion
|
||||
|
@ -125,7 +124,6 @@ export class Collection {
|
|||
|
||||
applyDelta(delta: Delta) {
|
||||
// TODO: handle delta representing entity deletion
|
||||
console.log('applying delta:', delta);
|
||||
const idPtr = delta.pointers.find(({localContext}) => localContext === 'id');
|
||||
if (!idPtr) {
|
||||
console.error('encountered delta with no entity id', delta);
|
||||
|
|
|
@ -47,9 +47,7 @@ class Users {
|
|||
}
|
||||
|
||||
(async () => {
|
||||
console.log('1');
|
||||
const users = new Users();
|
||||
console.log('2');
|
||||
|
||||
const app = express()
|
||||
app.get("/ids", (req: express.Request, res: express.Response) => {
|
||||
|
@ -94,11 +92,8 @@ class Users {
|
|||
});
|
||||
}
|
||||
|
||||
console.log('3');
|
||||
await bindPublish();
|
||||
console.log('3a');
|
||||
await bindReply();
|
||||
console.log('3b');
|
||||
runDeltas();
|
||||
runRequestHandlers();
|
||||
await new Promise((resolve) => setTimeout(resolve, 500));
|
||||
|
@ -107,7 +102,6 @@ class Users {
|
|||
askAllPeersForDeltas();
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
|
||||
console.log('4');
|
||||
const taliesin = users.upsert({
|
||||
// id: 'taliesin-1',
|
||||
name: 'Taliesin',
|
||||
|
|
|
@ -80,13 +80,11 @@ export async function askAllPeersForDeltas() {
|
|||
peers.forEach(async (peer, idx) => {
|
||||
console.log(`Asking peer ${idx} for deltas`);
|
||||
const deltas = await peer.askForDeltas();
|
||||
console.log('received deltas:', deltas);
|
||||
console.log(`received ${deltas.length}`);
|
||||
for (const delta of deltas) {
|
||||
delta.receivedFrom = peer.reqAddr;
|
||||
receiveDelta(delta);
|
||||
}
|
||||
console.log('deltasProposed count', deltasProposed.length);
|
||||
console.log('deltasAccepted count', deltasAccepted.length);
|
||||
ingestAll();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ export const subscribeSock = new Subscriber();
|
|||
|
||||
export async function bindPublish() {
|
||||
const addrStr = `tcp://${PUBLISH_BIND_ADDR}:${PUBLISH_BIND_PORT}`;
|
||||
console.log('addrStr:', addrStr);
|
||||
await publishSock.bind(addrStr);
|
||||
console.log(`Publishing socket bound to ${addrStr}`);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue