1
0
Fork 0

Change intervals

This commit is contained in:
Lim Chee Aun 2023-12-22 10:19:06 +08:00
parent 49fd8a5dc9
commit 6bcee318e4

View file

@ -205,7 +205,7 @@ function _threadifyStatus(status, propInstance) {
let prevStatus = states.statuses[key];
if (!prevStatus) {
if (fetchIndex++ > 3) throw 'Too many fetches for thread'; // Some people revive old threads
await new Promise((r) => setTimeout(r, 300 * fetchIndex)); // Be nice to rate limits
await new Promise((r) => setTimeout(r, 500 * fetchIndex)); // Be nice to rate limits
// prevStatus = await masto.v1.statuses.$.select(inReplyToId).fetch();
prevStatus = await fetchStatus(inReplyToId, masto);
saveStatus(prevStatus, instance, { skipThreading: true });
@ -227,7 +227,7 @@ function _threadifyStatus(status, propInstance) {
console.error(e, status);
});
}
export const threadifyStatus = rateLimit(_threadifyStatus, 300);
export const threadifyStatus = rateLimit(_threadifyStatus, 100);
const fetchStatus = pmem((statusID, masto) => {
return masto.v1.statuses.$select(statusID).fetch();