Paginatedquery rerunning
here's an example, I have one function called getHotPosts, which the query for looks like this
const results = await ctx.db
.query("threads")
.withIndex("by_hot", (q) => q.gt("score", 0))
.filter((q) =>
q.and(
q.eq(q.field("archived"), undefined),
q.gt(q.field("_creationTime"), stableSevenDaysAgo)
)
)
.order("desc")
.paginate(args.paginationOpts);
this function is only being ran once (besides when data changes)
then i have a function getNewPosts which is like this
const postsQuery = ctx.db
.query("threads")
.filter(q => q.eq(q.field("archived"), undefined))
.order("desc")
This function is being reran without any data changing about every 15 or so seconds. The usage on the frontend is exactly the same, eg all I have to do for it to start running is replace a usage of getHotPosts with getNewPosts and off it goes. How do I prevent this?
