You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what i've gathered, the app stops regularly after getting an empty page after a search request, despite having messages left. I've heard that it's because discord has to re-index messages every now and then, creating a small time window where search queries return empty results.
Event when setting a 40 seconds delay between searches, I couldn't run the script for more than a few minutes before having to restart it manually.
I'd like to suggest a simple, dirty fix: adding a retry count when this issue is encountered. I've tried it on my side, i updated the code as such:
else {
log.verb('Ended because API returned an empty page.');
log.verb('[End state]', this.state);
retryCount -= 1;
log.verb('Retrying count', retryCount);
if (retryCount > 0) {
await new Promise(r => setTimeout(r, 10000));
continue;
}
if (isJob) break; // break without stopping if this is part of a job
this.state.running = false;
}
(I hardcoded the retryCount to 50 on my side, the best practice would be to set it as a parameter, but I'll confess to being lazy. Same thing for the 10 seconds delay before retrying)
So far it hasn't banned me from discord, and allowed me to run the script for hours uninterrupted. I admit it's a quick and dirty fix, but while waiting for the prefetch feature it's a quick workaround.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
From what i've gathered, the app stops regularly after getting an empty page after a search request, despite having messages left. I've heard that it's because discord has to re-index messages every now and then, creating a small time window where search queries return empty results.
Event when setting a 40 seconds delay between searches, I couldn't run the script for more than a few minutes before having to restart it manually.
(issue example: #598 )
I'd like to suggest a simple, dirty fix: adding a retry count when this issue is encountered. I've tried it on my side, i updated the code as such:
(I hardcoded the retryCount to 50 on my side, the best practice would be to set it as a parameter, but I'll confess to being lazy. Same thing for the 10 seconds delay before retrying)
So far it hasn't banned me from discord, and allowed me to run the script for hours uninterrupted. I admit it's a quick and dirty fix, but while waiting for the prefetch feature it's a quick workaround.
Beta Was this translation helpful? Give feedback.
All reactions