Skip to content

Commit

Permalink
manubot#337 Add timeout to handler class.
Browse files Browse the repository at this point in the history
  • Loading branch information
xihh87 committed Jun 15, 2022
1 parent dcb360c commit 3dfdee8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion manubot/cite/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ class Handler:

prefix_lower: str
prefixes = []
timeout_seconds: int = 3

def _get_pattern(self, attribute: str = "accession_pattern") -> Optional[Pattern]:
"""
Expand Down Expand Up @@ -137,7 +138,9 @@ def standardize_prefix_accession(self, accession: str) -> Tuple[str, str]:
return standard_prefix, standard_accession

@abc.abstractmethod
def get_csl_item(self, citekey: CiteKey) -> Dict[str, Any]:
def get_csl_item(
self, citekey: CiteKey, timeout: int = timeout_seconds
) -> Dict[str, Any]:
"""
Return a CSL_Item with bibliographic details for citekey.
"""
Expand Down

0 comments on commit 3dfdee8

Please sign in to comment.