Browse Source

Initialise z-score of *:score entries to a weighted value

This makes time have some weight in the initial scores in the *:score zsets so a
items can be fetched by the time they were entered in. The time is scaled down
by a factor of 1000000000 so the difference between zsets is single digits.
master
Bonface Munyoki 2 years ago
parent
commit
2acb06f9e9
Signed by: bonfacemunyoki GPG Key ID: F5BBAE1E0392253F
  1. 4
      private/github.rkt
  2. 2
      private/twitter.rkt

4
private/github.rkt

@ -98,7 +98,9 @@
(redis-hash-set! c key "url" (feed-commit-url commit*))
(redis-hash-set! c key "hash" (feed-commit-hash commit*))
(redis-hash-set! c key "score" "0")
(redis-zset-add! c "commit-score:" key 0)
(redis-zset-add! c "commit-score:"
key
(/ timeposted/seconds 1000000000.0))
(redis-zset-add! c "commit-time:" key timeposted/seconds)
(redis-expire-in! c key (* 7 24 60 60 100))
(redis-zset-add! c "score:" key 0)])))

2
private/twitter.rkt

@ -126,7 +126,7 @@
c
"tweet-score:"
key
0)
(/ timeposted 1000000000.0))
(redis-zset-add!
c
"tweet-time:"

Loading…
Cancel
Save