Skip to content

Commit

Permalink
Merge branch 'main' into link-start-stop-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
Bubobubobubobubo committed Jun 19, 2024
2 parents 80dadce + 8d3455b commit 4d922b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions sardine_core/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
p = Player(name=player)
globals()[player] = p
bowl.add_handler(p)
del p

# Extensions
# An extension configuration file contains the following fields:
Expand Down
5 changes: 4 additions & 1 deletion sardine_core/scheduler/async_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,15 @@ async def _call_func(self, func, args, kwargs):
"""Calls the given function and optionally applies time shift
according to the `defer_beats` attribute.
"""
signature = inspect.signature(func)
valid_kwargs = {k: v for k, v in kwargs.items() if k in signature.parameters}

if self.defer_beats:
delta = self.clock.time - self._expected_time
shift = self.defer_beats * self.clock.beat_duration - delta
self.time.shift += shift

return await maybe_coro(func, *args, **kwargs)
return await maybe_coro(func, *args, **valid_kwargs)

def _get_period(self, state: Optional[FunctionState]) -> Union[float, int]:
"""
Expand Down

0 comments on commit 4d922b1

Please sign in to comment.