Browse Source

send random number of posts between 1 and 50, adjust client request speed

master
Ev Bogue 3 years ago
parent
commit
2d741344de
  1. 3
      server.js
  2. 2
      views.js

3
server.js

@ -114,7 +114,6 @@ bog.keys().then(key => {
wserve.on('connection', function (ws) {
ws.on('message', function (message) {
var req = JSON.parse(message)
console.log(req)
if (req.sendpub) {
ws.send(key.publicKey)
} else {
@ -221,7 +220,7 @@ bog.keys().then(key => {
})
}
if (unboxedreq.seq < msg.seq) {
var endrange = feed.length - unboxedreq.seq - 25
var endrange = feed.length - unboxedreq.seq - Math.floor(Math.random() * 50 + 1)
if (endrange < 0) {
endrange = feed.length - unboxedreq.seq - 1
}

2
views.js

@ -15,7 +15,7 @@ function profilePage (src, keys) {
var subs = [src]
var interval = 500
var interval = 2500
timer = function() {
if (src === window.location.hash.substring(1)) {
if (interval < 10000) { interval = interval + 50 }

Loading…
Cancel
Save