change from/to

isekai-main
Barış Soner Uşaklı 2 years ago
parent 6faec9376e
commit 9ac52dbf5f

@ -101,10 +101,10 @@ events.log = async function (data) {
events.getEvents = async function (filter, start, stop, from, to) { events.getEvents = async function (filter, start, stop, from, to) {
// from/to optional // from/to optional
if (from === undefined) { if (from === undefined) {
from = 0; from = '-inf';
} }
if (to === undefined) { if (to === undefined) {
to = Date.now(); to = '+inf';
} }
const eids = await db.getSortedSetRevRangeByScore(`events:time${filter ? `:${filter}` : ''}`, start, stop - start + 1, to, from); const eids = await db.getSortedSetRevRangeByScore(`events:time${filter ? `:${filter}` : ''}`, start, stop - start + 1, to, from);

Loading…
Cancel
Save