1
0
mirror of https://gitlab.com/openlp/openlp.git synced 2024-12-25 11:14:07 +00:00

Fix deadlock issue in Web API.

This commit is contained in:
Chris Witterholt 2024-11-03 10:25:48 +00:00
parent 81fb0e0610
commit 4642c5c3f9
3 changed files with 3 additions and 4 deletions

View File

@ -109,7 +109,6 @@ def login():
def main_image():
live_controller = Registry().get('live_controller')
img_data = live_controller.staticMetaObject.invokeMethod(
live_controller, 'grab_maindisplay', QtCore.Qt.ConnectionType.BlockingQueuedConnection,
QtCore.Q_RETURN_ARG(str))
live_controller, 'grab_maindisplay', QtCore.Qt.ConnectionType.DirectConnection, QtCore.Q_RETURN_ARG(str))
img = 'data:image/jpeg;base64,{}'.format(img_data)
return jsonify({'binary_image': img})

View File

@ -46,7 +46,7 @@ def search(plugin_name, text):
if hasattr(plugin.media_item.search, '__pyqtSignature__'):
# If this method has a signature, it means that it should be called from the parent thread
results = plugin.media_item.staticMetaObject.invokeMethod(
plugin.media_item, 'search', QtCore.Qt.ConnectionType.BlockingQueuedConnection,
plugin.media_item, 'search', QtCore.Qt.ConnectionType.DirectConnection,
QtCore.Q_RETURN_ARG(list), QtCore.Q_ARG(str, text), QtCore.Q_ARG(bool, False))
else:
# Fall back to original behaviour

View File

@ -54,7 +54,7 @@ def test_search_threaded(registry, settings):
invoke_call = mocked_songs_plugin.media_item.staticMetaObject.invokeMethod.call_args_list[0]
assert invoke_call.args[0] is mocked_songs_plugin.media_item
assert invoke_call.args[1] == 'search'
assert invoke_call.args[2] == QtCore.Qt.ConnectionType.BlockingQueuedConnection
assert invoke_call.args[2] == QtCore.Qt.ConnectionType.DirectConnection
def test_search_unthreaded(registry, settings):