Skip to content

Commit

Permalink
mypy suggested type setting
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcounsell committed Jul 20, 2022
1 parent 48943b4 commit ca4eeac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/popoto/redis_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
logger.info(str(e))


def set_REDIS_DB_settings(env_partition_name: str = "", *args, **kwargs):
def set_REDIS_DB_settings(
env_partition_name: str = "", *args, **kwargs
) -> None:
# todo: use this to mark keys in redis db, so they can be separated and deleted
env_partition_name = env_partition_name or os.environ.get("ENV", "")

Expand All @@ -50,7 +52,7 @@ def get_REDIS_DB():
return POPOTO_REDIS_DB


def print_redis_info():
def print_redis_info() -> None:
logger.info(POPOTO_REDIS_DB.info())

used_memory, maxmemory = int(POPOTO_REDIS_DB.info()["used_memory"]), int(
Expand Down
3 changes: 2 additions & 1 deletion src/popoto/utils/multithreading.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# A DECORATOR FOR PYTHON THREADING
# http://docs.python.org/2/library/threading.html#thread-objects
# http://stackoverflow.com/questions/18420699/multithreading-for-python-django
from collections.abc import Callable
from threading import Thread


def start_new_thread(function):
def start_new_thread(function) -> Callable:
"""
if running Django relational database transactions,
include this at the end of your function
Expand Down

0 comments on commit ca4eeac

Please sign in to comment.