Skip to content

Commit

Permalink
Merge pull request #297 from liampauling/task/streaming-optimisations
Browse files Browse the repository at this point in the history
lrucache added to strip_datetime, this function is used a lot, especa…
  • Loading branch information
liampauling committed May 8, 2020
2 parents 3b63d5c + cbc2bc3 commit f538f2d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions betfairlightweight/resources/baseresource.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import functools
import datetime
from typing import Union, Optional

Expand All @@ -20,6 +21,7 @@ def json(self) -> str:
return json.dumps(self._data)

@staticmethod
@functools.lru_cache()
def strip_datetime(value: Union[str, int]) -> Optional[datetime.datetime]:
"""
Converts value to datetime if string or int.
Expand Down

0 comments on commit f538f2d

Please sign in to comment.