Skip to content

Commit

Permalink
make it easier to test initialization thread delays
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Mar 29, 2023
1 parent dd9b8b0 commit a0a44fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xpra/server/mixins/encoding_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#pylint: disable-msg=E1101

from xpra.scripts.config import parse_bool_or_int
from xpra.util import envint
from xpra.os_util import bytestostr, OSX
from xpra.codecs.codec_constants import preforder
from xpra.codecs.loader import get_codec, has_codec, codec_versions, load_codec
Expand All @@ -16,6 +17,8 @@

log = Logger("encoding")

INIT_DELAY = envint("XPRA_ENCODER_INIT_DELAY", 0)


class EncodingServer(StubServerMixin):
"""
Expand Down Expand Up @@ -75,6 +78,9 @@ def reinit_encodings(self):
ss.reinit_encodings(self)

def threaded_setup(self):
if INIT_DELAY>0:
from time import sleep
sleep(INIT_DELAY)
#load the slower codecs
if "jpeg" in self.allowed_encodings and not OSX:
load_codec("enc_nvjpeg")
Expand Down

0 comments on commit a0a44fc

Please sign in to comment.