Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
docsteveharris committed May 8, 2023
1 parent bc0b51b commit 6fc8901
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 2 additions & 0 deletions web/src/web/gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
if getenv("DEBUG") == "1":
logger.info("Debug mode enabled for Gunicorn (incl hot reload)")
debug = True
else:
debug = False

bind = "0.0.0.0:8000"
reload = True if debug else False
Expand Down
8 changes: 1 addition & 7 deletions web/src/web/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,7 @@ def wrapped(*args: P.args, **kwargs: P.kwargs) -> T:
logger_ = logger.opt(depth=1)
start = time.time()
# catch type errors
try:
result = func(*args, **kwargs)
except TypeError as e:
logger.error(
"logger_timeit: unable to handle tuples etc. - try removing the logger_timeit decorator from your function"
)
raise TypeError from e
result = func(*args, **kwargs)
end = time.time()
logger_.log(
level, f"Function {name} returned in" f" {1000 * (end - start):.1f}ms"
Expand Down

0 comments on commit 6fc8901

Please sign in to comment.