aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gossip.js3
-rw-r--r--server.js6
2 files changed, 2 insertions, 7 deletions
diff --git a/gossip.js b/gossip.js
index d86d3a4..73ea5ab 100644
--- a/gossip.js
+++ b/gossip.js
@@ -85,10 +85,9 @@ function sync (subs, keys) {
localforage.getItem(msg.author).then(feed => {
open(feed[0]).then(lastmsg => {
if (unboxedreq.length + lastmsg.seq === msg.seq) {
- console.log('combinable feeds')
var newlog = unboxedreq.concat(feed)
localforage.setItem(msg.author, newlog).then(success => {
- console.log('combined existing feed with diff and saved to client')
+ console.log('combined existing feed of ' + msg.author + ' with diff and saved to client')
})
localforage.getItem('log').then(log => {
if (!log) {
diff --git a/server.js b/server.js
index f024d73..d35610f 100644
--- a/server.js
+++ b/server.js
@@ -106,16 +106,12 @@ bog.keys().then(key => {
})
} if (msg.seq > unboxedreq.length) {
fs.readFile(__dirname + '/bogs/' + msg.author, 'UTF-8', function (err, data) {
- console.log('read existing feed from disk')
var feed = JSON.parse(data)
bog.open(feed[0]).then(lastmsg => {
- console.log(msg.seq)
- console.log(lastmsg.seq)
if (unboxedreq.length + lastmsg.seq === msg.seq) {
- console.log('combinable feeds')
var newlog = unboxedreq.concat(feed)
fs.writeFile(__dirname + '/bogs/' + msg.author, JSON.stringify(newlog), 'UTF-8', function (err, success) {
- console.log('combined existing feed with diff and saved to server')
+ console.log('combined existing feed of ' + msg.author + ' with diff and saved to server')
})
}
})