diff --git a/apps/ssb.json b/apps/ssb.json index 68a1bfd6..6e8cfc1c 100644 --- a/apps/ssb.json +++ b/apps/ssb.json @@ -1,5 +1,5 @@ { "type": "tildefriends-app", "emoji": "🦀", - "previous": "&PP5y+K7wgLxdkeeb4iqyK1Fb+vwS9LjLJDt2FPrVlpo=.sha256" + "previous": "&e997wZKsisgdoMKDf52LAk4Vzzdhbp9M25eC68AoReE=.sha256" } diff --git a/apps/ssb/tf-app.js b/apps/ssb/tf-app.js index b1d7a279..8e73f3cc 100644 --- a/apps/ssb/tf-app.js +++ b/apps/ssb/tf-app.js @@ -148,6 +148,7 @@ class TfElement extends LitElement { async fetch_about(ids, users) { const k_cache_version = 1; let cache = await tfrpc.rpc.databaseGet('about'); + let original_cache = cache; cache = cache ? JSON.parse(cache) : {}; if (cache.version !== k_cache_version) { cache = { @@ -213,7 +214,13 @@ class TfElement extends LitElement { } } cache.last_row_id = max_row_id; - await tfrpc.rpc.databaseSet('about', JSON.stringify(cache)); + let new_cache = JSON.stringify(cache); + if (new_cache !== original_cache) { + let start_time = new Date(); + tfrpc.rpc.databaseSet('about', new_cache).then(function() { + console.log('saving about took', (new Date() - start_time) / 1000); + }); + } users = users || {}; for (let id of Object.keys(cache.about)) { users[id] = Object.assign(users[id] || {}, cache.about[id]);