mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-07 10:40:09 +00:00
Huge speed improvements if more than one request is in the queue. Speeds up every request by 0.1 seconds.
This commit is contained in:
parent
1909744631
commit
fc6f170731
@ -52,6 +52,11 @@ class Master:
|
|||||||
|
|
||||||
def tick(self, q):
|
def tick(self, q):
|
||||||
try:
|
try:
|
||||||
|
# This endless loop is running until the 'Queue.Empty'
|
||||||
|
# exception is thrown. If more than one request is in
|
||||||
|
# the queue, this speeds up every request by 0.1 seconds,
|
||||||
|
# because get_input(..) function is not blocking.
|
||||||
|
while True:
|
||||||
# Small timeout to prevent pegging the CPU
|
# Small timeout to prevent pegging the CPU
|
||||||
msg = q.get(timeout=0.01)
|
msg = q.get(timeout=0.01)
|
||||||
self.handle(msg)
|
self.handle(msg)
|
||||||
|
Loading…
Reference in New Issue
Block a user