Skip to content

Commit a5a5d12

Browse files
committed
Run HarvestTask only if needed
Signed-off-by: cyc60 <avsysoev60@gmail.com>
1 parent c43959f commit a5a5d12

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/commands/start.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,6 @@ async def main() -> None:
294294
logger.info('Started operator service')
295295
with InterruptHandler() as interrupt_handler:
296296
while not interrupt_handler.exit:
297-
await HarvestTask().run()
298297
await ValidatorsTask(
299298
keystores=keystores,
300299
remote_signer_config=remote_signer_config,
@@ -304,6 +303,8 @@ async def main() -> None:
304303
keystores=keystores,
305304
remote_signer_config=remote_signer_config,
306305
).run()
306+
if settings.harvest_vault:
307+
await HarvestTask().run()
307308
await MetricsTask().run()
308309
await WalletTask().run()
309310

src/harvest/tasks.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313
class HarvestTask(BaseTask):
1414
async def process_block(self) -> None:
1515
"""Check vault state and send harvest transaction if needed."""
16-
if not settings.harvest_vault:
17-
return
18-
1916
if not await keeper_contract.can_harvest(settings.vault):
2017
return
2118

0 commit comments

Comments
 (0)