pull/64/head
Dessalines 2019-04-06 10:01:02 -07:00
parent a63c86c0cc
commit 24bdae28d7
2 changed files with 2 additions and 2 deletions

View File

@ -22,4 +22,4 @@ script:
env:
- DATABASE_URL=postgres://rrr:rrr@localhost/rrr
addons:
postgresql: "10"
postgresql: "9.4"

View File

@ -5,7 +5,7 @@ create or replace function hot_rank(
returns integer as $$
begin
-- hours_diff:=EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600
return 10000*sign(score)*log(1 + abs(score)) / power(((EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600) + 2), 1.8);
return floor(10000*sign(score)*log(1 + abs(score)) / power(((EXTRACT(EPOCH FROM (timezone('utc',now()) - published))/3600) + 2), 1.8))::integer;
end; $$
LANGUAGE plpgsql;