mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-13 08:15:59 +00:00
Handle cancellation before execution
This commit is contained in:
1 parent
a85d54f3a5
commit
7bef2b21b5
1 file changed
+4
@@ -222,6 +222,10 @@ class SerenaAgent:
|
||||
|
||||
def run_task() -> None:
|
||||
try:
|
||||
if self.future.done():
|
||||
if self.logged:
|
||||
log.info(f"Task {self.name} was already completed before start; skipping execution")
|
||||
return
|
||||
with LogTime(self.name, logger=log, enabled=self.logged):
|
||||
result = self._function()
|
||||
if not self.future.done():
|
||||
|
||||
Reference in new issue
Block a user