From: Michael Tremer Date: Thu, 6 Feb 2025 14:43:39 +0000 (+0000) Subject: backend: Allow passing keyword arguments to background tasks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5526b28faf39d2c388f45858701be0054d4906d3;p=pbs.git backend: Allow passing keyword arguments to background tasks Signed-off-by: Michael Tremer --- diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index 57d1c0f5..b08e1fcc 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -186,12 +186,12 @@ class Backend(object): # Functions to run something in background - def run_task(self, callback, *args): + def run_task(self, callback, *args, **kwargs): """ Runs the given coroutine in the background """ # Create a new task - task = asyncio.create_task(callback(*args)) + task = asyncio.create_task(callback(*args, **kwargs)) # Keep a reference to the task and remove it when the task has finished self.__tasks.add(task)