Skip to content

Commit

Permalink
Remove commented code
Browse files Browse the repository at this point in the history
  • Loading branch information
sudan45 committed Dec 11, 2024
1 parent e84c3b5 commit 3a7241d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 30 deletions.
20 changes: 0 additions & 20 deletions utils/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import functools
import logging
import re

# import time
import typing

from asgiref.sync import sync_to_async
Expand Down Expand Up @@ -50,24 +48,6 @@ def logger_log_extra(context_data):
}


# @contextmanager
# def redis_lock(lock_id: str):
# timeout_at = time.monotonic() + settings.REDIS_LOCK_EXPIRE - 3
# # cache.add fails if the key already exists
# status = cache.add(lock_id, 1, settings.REDIS_LOCK_EXPIRE)
# try:
# yield status
# finally:
# # memcache delete is very slow, but we have to use it to take
# # advantage of using add() for atomic locking
# if time.monotonic() < timeout_at and status:
# # don't release the lock if we exceeded the timeout
# # to lessen the chance of releasing an expired lock
# # owned by someone else
# # also don't release the lock if we didn't acquire it
# cache.delete(lock_id)


@sync_to_async
def get_object_or_404_async(queryset, **kwargs):
return get_object_or_404(queryset, **kwargs)
Expand Down
10 changes: 0 additions & 10 deletions utils/strawberry/mutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,16 +261,6 @@ def __init__(
@staticmethod
def check_permissions(info, permission) -> CustomErrorType | None:
return None
# if permission and not info.context.has_perm(permission):
# errors = CustomErrorType([
# dict(
# field="nonFieldErrors",
# messages="You don't have enough permission",
# object_errors=None,
# array_errors=None,
# )
# ])
# return errors

@staticmethod
@sync_to_async
Expand Down

0 comments on commit 3a7241d

Please sign in to comment.