Skip to content

Commit

Permalink
Merge 9310eaa into 5b194d9
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibob7 committed Jul 11, 2019
2 parents 5b194d9 + 9310eaa commit bd1501d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion esque/__version__.py
@@ -1 +1 @@
__version__ = "0.1.3a"
__version__ = "0.1.4a"
6 changes: 3 additions & 3 deletions esque/cli/output.py
Expand Up @@ -7,7 +7,7 @@

from esque.topic import Topic

C_MAX_INT = 2 ** 31 - 1
MILLISECONDS_PER_YEAR = 1000 * 3600 * 24 * 365


def _indent(level: int):
Expand Down Expand Up @@ -117,8 +117,8 @@ def pretty_duration(value: Any, *, multiplier: int = 1) -> str:
value *= multiplier

# Fix for conversion errors of ms > C_MAX_INT in some internal lib
if value > C_MAX_INT:
value = int(value / 1000 / 3600 / 24 / 365)
if value > MILLISECONDS_PER_YEAR:
value = int(value / MILLISECONDS_PER_YEAR)
return pendulum.duration(years=value).in_words()

return pendulum.duration(milliseconds=value).in_words()
Expand Down

0 comments on commit bd1501d

Please sign in to comment.