Skip to content

Commit 6fcfea5

Browse files
committed
Hack to make processing of thousands of thumbnails work more reliable, until a thread pool solution can be found.
1 parent e168acf commit 6fcfea5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/classes/thumbnail.py

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import re
3030
import openshot
3131
import socket
32+
import time
3233
from threading import Thread
3334
from classes import info
3435
from classes.query import File
@@ -99,6 +100,11 @@ class httpThumbnailHandler(BaseHTTPRequestHandler):
99100
""" This class handles HTTP requests to the HTTP thumbnail server above."""
100101

101102
def do_GET(self):
103+
# Pause processing of request (since we don't currently use thread pooling, this allows
104+
# the threads to be processed without choking the CPU as much
105+
# TODO: Make HTTPServer work with a limited thread pool and remove this sleep() hack.
106+
time.sleep(0.01)
107+
102108
""" Process each GET request and return a value (image or file path)"""
103109
# Parse URL
104110
url_output = REGEX_THUMBNAIL_URL.findall(self.path)

0 commit comments

Comments
 (0)