Skip to content
Snippets Groups Projects
Commit 0d574b4e authored by echicken's avatar echicken :chicken:
Browse files

Don't let the background worker jelly too many messages into the queue if the...

Don't let the background worker jelly too many messages into the queue if the user is off doing something else.
parent 8dbcf694
No related branches found
No related tags found
No related merge requests found
...@@ -63,11 +63,13 @@ js.time_limit = 0; ...@@ -63,11 +63,13 @@ js.time_limit = 0;
let now = time(); let now = time();
let sscan = now - 30; let sscan = now - 30;
while (!js.terminated && !queue.orphan) { while (!js.terminated && !queue.orphan) {
if (queue.write_level < 10) { // Command shell isn't reading from queue right now, so don't keep filling it
now = time(); now = time();
if (now - sscan >= 30) { if (now - sscan >= 30) {
sscan = now; sscan = now;
scanSubs(); scanSubs();
} }
scanInstantMessages(); scanInstantMessages();
}
mswait(1000); mswait(1000);
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment