Minor code clean up
See original GitHub issue- Change from
to thereturn await self._client.mget(keys[0], *keys[1:])
return await self._client.mget(*keys)
- Change from
to theif isinstance(value, int) or value.isdigit(): return int(value)
if isinstance(value, int) return value if value.isdigit(): return int(value)
- Refactor magic hidden converting under the hood from microseconds to seconds based only on variable type:
if isinstance(expire, float):
pexpire = int(expire * 1000)
expire = None
-
This seems to be unnecessary because on
__del__
callself._client
will be deleted too:def close(self): del self._client self._client = None self.__is_init = False __del__ = close
- Using
class none: pass
seems to be redundant becauseNone
is pickled and unpickled back. I do not understand the purpose of the
because you can remove at allvalue = pickle.loads(value, fix_imports=False, encoding="bytes") if value is none: return None
class none: pass
class, and just doreturn value
.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Minor code cleanup [#2841268] | Drupal.org
This removes the LICENSE.txt file, cleans up the module's structure a bit, and adds media_wysiwyg as a dependency. Log in or register to...
Read more >Code Cleanup: 7 Simple Daily Steps That Pay off in the End
Code cleanup doesn't have to be an arduous job. Learn seven simple steps you can perform daily to keep your codebase in great...
Read more >Minor code cleanup by dbaeumer · Pull Request #132 · microsoft/lsif ...
Minor code cleanup #132 ... Hiding of all comments behaves strange when one PR is checked out and one not microsoft/vscode-pull-request-github#2936.
Read more >Bringing Code Cleanup on Save To Visual Studio 2022 17.1 ...
First, navigate to Analyze > Code Cleanup > Configure Code Cleanup to personalize desirable customizations to your code cleanup profile(s).
Read more >Code style and cleanup | JetBrains Rider Documentation
Violations of code formatting rules as well as some other minor inconsistencies are not highlighted for the reason of keeping your code readable ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yep, thank to point it. I hope that is no doubts about
socket_keepalive
- the same setting we have in our browsers in it set totrue
. To be honest there is no reason whysocket_timeout
is exactly 0.1 by default. I just want to set it with a small amount based on my experience. We had an issues with cache when it stacked and we got the whole app down by the end just because timeout had a big value or didn’t set. I don’t think that we can count the value for socket timeout, but for cache it should be extremely small just because of the purpose of cache.I saw some redis benchmarks and they said that average response time is 200 us ( 0.0002 sec) ! and 100 percentile took less then 3 ms ( 0.003 sec) (https://redis.io/topics/benchmarks) !
Do you have some suggestions for that value?
@AIGeneratedUsername Can I ask you for review this PR ?