Skip to content

Commit

Permalink
refactor: remove unused SilverbackApp.checkpoint() method
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeshultz committed Nov 18, 2023
1 parent 2564382 commit e4caa59
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
4 changes: 0 additions & 4 deletions silverback/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ def __init__(self, settings: Optional[Settings] = None):
f"{signer_str}{start_block_str}{new_block_timeout_str}"
)

def checkpoint(self, last_block_seen: int, last_block_processed: int):
self.broker.state.last_block_seen = last_block_seen
self.broker.state.last_block_processed = last_block_processed

def on_startup(self) -> Callable:
"""
Code to execute on one worker upon startup / restart after an error.
Expand Down
10 changes: 0 additions & 10 deletions silverback/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ async def _checkpoint(
self.last_block_seen = max(last_block_seen, self.last_block_seen)
self.last_block_processed = max(last_block_processed, self.last_block_processed)

self.app.checkpoint(self.last_block_seen, self.last_block_processed)

if self.persistence:
await self.persistence.set_instance_state(
self.ident, self.last_block_seen, self.last_block_processed
Expand Down Expand Up @@ -109,14 +107,6 @@ async def run(self):
self.last_block_seen = boot_state.last_block_seen
self.last_block_processed = boot_state.last_block_processed

# NOTE: This will update TaskIQ state before app startup.
# TODO: I have no idea if this will work with a distributed runner/worker
# setup. That may require our own injected startup task, but it's unclear if
# we can do that before Taskiq's startup handlers. We might be able to force
# SilverbackApplication to decorate an internal func to handle it. Need to
# figure that out.
self.app.checkpoint(self.last_block_seen, self.last_block_processed)

await self.app.broker.startup()

# Execute Silverback startup task before we init the rest
Expand Down

0 comments on commit e4caa59

Please sign in to comment.