Skip to content

Commit 10e4fc4

Browse files
Fix compat
1 parent a113d00 commit 10e4fc4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

examples/blender/blender.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ async def worker(ctx: WorkContext, tasks):
3434
)
3535
ctx.run("/golem/entrypoints/run-blender.sh")
3636
ctx.download_file(f"/golem/output/out{frame:04d}.png", f"output_{frame}.png")
37-
yield task, ctx.commit()
37+
yield ctx.commit(task)
3838
# TODO: Check if job results are valid
3939
# and reject by: task.reject_task(msg = 'invalid file')
4040
task.accept_task()

yapapi/runner/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def __init__(
157157
self._budget_allocation: Optional[rest.payment.Allocation] = None
158158

159159
async def map(
160-
self, worker: Callable[[WorkContext, AsyncIterator["Task"]], AsyncIterator[Tuple["Task", Work]]], data
160+
self, worker: Callable[[WorkContext, AsyncIterator["Task"]], AsyncIterator[Work]], data
161161
):
162162
import asyncio
163163
import contextlib

yapapi/runner/ctx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def download_file(self, src_path: str, dst_path: str):
173173
def log(self, *args):
174174
print(f"W{self._id}: ", *args)
175175

176-
def commit(self) -> Work:
176+
def commit(self, task: "Task") -> Tuple["Task", Work]:
177177
steps = self._pending_steps
178178
self._pending_steps = []
179-
return _Steps(*steps)
179+
return task, _Steps(*steps)

0 commit comments

Comments
 (0)