diff --git a/snowflake/snowflake.py b/snowflake/snowflake.py index 2be34cf..7f44a42 100644 --- a/snowflake/snowflake.py +++ b/snowflake/snowflake.py @@ -74,7 +74,7 @@ def __int__(self) -> int: class SnowflakeGenerator: def __init__(self, instance: int, *, seq: int = 0, epoch: int = 0, timestamp: Optional[int] = None): - current = int(time() * 1000.) + current = (time() * 1000.).__int__() if current - epoch >= MAX_TS: raise OverflowError(f"The maximum current timestamp has been reached in selected epoch," @@ -112,7 +112,7 @@ def __iter__(self): return self def __next__(self) -> Optional[int]: - current = int(time() * 1000.) - self._epo + current = (time() * 1000.).__int__() - self._epo if current >= MAX_TS: raise OverflowError(f"The maximum current timestamp has been reached in selected epoch,"