Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
Disable Task.initialize execution timeout (#4354)
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranciszkiewicz authored and mplebanski committed Jul 4, 2019
1 parent 602af23 commit 1684f8f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions golem/core/deferred.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from queue import Queue, Empty
from typing import Any, Callable, Dict, Tuple, List
from typing import Any, Callable, Dict, List, Optional, Tuple, Union

from twisted.internet import defer
from twisted.internet.task import deferLater
Expand All @@ -16,7 +16,7 @@ def push(self, fn: Callable, *args, **kwargs) -> 'DeferredSeq':
return self

def execute(self) -> defer.Deferred:
return deferToThread(lambda: sync_wait(self._execute()))
return deferToThread(lambda: sync_wait(self._execute(), timeout=None))

@defer.inlineCallbacks
def _execute(self) -> Any:
Expand All @@ -39,7 +39,9 @@ def resolve(_):
return result


def sync_wait(deferred, timeout=10):
def sync_wait(deferred: defer.Deferred,
timeout: Optional[Union[int, float]] = 10.) -> Any:

if not isinstance(deferred, defer.Deferred):
return deferred

Expand Down

0 comments on commit 1684f8f

Please sign in to comment.