From 44fd1db11c2ecb2e85a03b873748b4888876de31 Mon Sep 17 00:00:00 2001 From: "Andres D. Molins" Date: Thu, 19 Oct 2023 16:48:49 +0200 Subject: [PATCH] Fix: Added default frequency ensuring is an int always. --- src/aleph/vm/controllers/firecracker/snapshot_manager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/aleph/vm/controllers/firecracker/snapshot_manager.py b/src/aleph/vm/controllers/firecracker/snapshot_manager.py index 28d1e5e2e..8ab3a4d6c 100644 --- a/src/aleph/vm/controllers/firecracker/snapshot_manager.py +++ b/src/aleph/vm/controllers/firecracker/snapshot_manager.py @@ -100,15 +100,14 @@ async def start_for(self, execution: VmExecution, frequency: Optional[int] = Non msg = "Snapshots are not implemented for programs." raise NotImplementedError(msg) - if not frequency: - frequency = settings.SNAPSHOT_FREQUENCY + default_frequency = frequency or settings.SNAPSHOT_FREQUENCY vm_hash = execution.vm_hash snapshot_execution = SnapshotExecution( scheduler=self._scheduler, vm_hash=vm_hash, execution=execution, - frequency=frequency, + frequency=default_frequency, ) self.executions[vm_hash] = snapshot_execution await snapshot_execution.start()