Discussions
Update recipe for stale/old link
almost 3 years ago by Joachim
The recipe given to delete links older than a certain amount of time is not optimized as by default it retrieves all links ordered by creation time descending.
Which means we start by iterating over link that are valid for nothing.
Wouldn't it be wiser to set the corresponding code
querystring = urlencode({
"limit": MAX_PAGE_SIZE,
"last": lastLink["id"] if lastLink else "",
"orderBy": "createdAt",
"orderDir": "desc"
})
to
querystring = urlencode({
"limit": MAX_PAGE_SIZE,
"last": lastLink["id"] if lastLink else "",
"orderBy": "createdAt",
"orderDir": "asc"
})