This is beneficial since unlink is non blocking, it will run in a different thread if the data passed is large
https://redis.io/commands/unlink/
Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This is more intuitive and consistent with other things like `frappe.db`.
PS: This is quite likely to break some weird usage which I can't guess right now. Normal usage inside request/job cycles will continue to work as it used to.
refactor: clean up code to py39+ supported syntax
- f-strings instead of format
- latest typing support instead of pre 3.9 TitleCase
- remove UTF-8 declarations.
- many more changes
Powered by https://github.com/asottile/pyupgrade/ + manual cleanups
As per current implementation whenever `get_doc` is called, document is
cached. However, this cache is only ever used by `get_cached_doc`. Going
through the codebase of both FF/ERPNext you'll find that `get_doc` is
used a lot more than `get_cached_doc`. So in many places, all this
caching overhead is unnecessary.
This change removes implicit caching from get_doc and replaces it with
cache-replacement instead. i.e. cache is only updated if it exists but
not created from get_doc.
Pros:
- faster `get_doc`
- lower memory usage on Redis
- Reduces chances of OOM by blowing up worker's memory as old docs can't
be GCed until
- Correctness i.e. caching only what gets used from cache.
Con:
- After this change. First call to `get_cached_doc` will always be a cache miss. DUH.
The license.txt file has been replaced with LICENSE for quite a while
now. INAL but it didn't seem accurate to say "hey, checkout license.txt
although there's no such file". Apart from this, there were
inconsistencies in the headers altogether...this change brings
consistency.
* Remove six for PY2 compatability since our dependencies are not, PY2
is legacy.
* Removed usages of utils from future/past libraries since they are
deprecated. This includes 'from __future__ ...' and 'from past...'
statements.
* Removed compatibility imports for PY2, switched from six imports to
standard library imports.
* Removed utils code blocks that handle operations depending on PY2/3
versions.
* Removed 'from __future__ ...' lines from templates/code generators
* Used PY3 syntaxes in place of PY2 compatible blocks. eg: metaclass
- For better HTTP caching and cache busting
- assets.json is created under [app]/dist folder which contains the map
of input file and output file name, this is used to get the correct path for
bundled assets
RedisWrapper inherits from Redis which inherits from StrictRedis
In redis-py 3.0.0 StrictRedis was renamed to Redis.
This seems like a harmless change, but, instead of using
`self(RedisWrapper ...`, all methods use `self(Redis ...`
which assumes previous hierarchy (i.e. RedisWrapper <- Redis <- StrictRedis)
- added a new weekly hook to check if new version update is available
- added function to desk.js to show popup in case a new version is
available
- added redis wrappers for set related commands, namely sadd, srem,
sismember, spop, srandmember, smembers
* Fixed dict_keys and lists
* [FIX] config.get keys must be list
* [FIX] pickle all objects
* [FIX] get versions in unicode
* [FIX] get log versions
* debugging
* Fixed commit ID reference
* Fixed branch reference
* Fixed doc keys to list
* [LOG] test log
* [LOG] test log
* Convert iterators to list
* removed logs
* [FIX] Trial to load templates
* Fixed codacy