diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-12 12:39:40 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-09-13 13:34:27 +0200 |
commit | 296ee1376450adf58a040a9da816a100fa5d2ec9 (patch) | |
tree | bf7d12d69c5c3b8670f28a58e524200db008e8a0 /ishtar_common/models.py | |
parent | c8a27a7f986adb1e3d0eb911acffa02d030cc85f (diff) | |
download | Ishtar-296ee1376450adf58a040a9da816a100fa5d2ec9.tar.bz2 Ishtar-296ee1376450adf58a040a9da816a100fa5d2ec9.zip |
⚡️ improve performance - external ID: prevent double save - user UPDATE query instead of save - remove dead code "BulkUpdatedItem"
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 394bd5382..48ed55e77 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -577,29 +577,6 @@ class ImageModel(models.Model, ImageContainerModel): return "{}-thumb.{}".format(".".join(splited[:-1]), splited[-1]) -class BulkUpdatedItem(object): - @classmethod - def bulk_recursion(cls, transaction_id, extra_args): - """ - Prevent infinite recursion. Should not happen but wrong manipulation - in the database or messy imports can generate circular relations - - :param transaction_id: current transaction ID (unix time) - if null - a transaction ID is generated - :param extra_args: arguments dealing with - :return: (transaction ID, is a recursion) - """ - # TODO: no more bulk update - should be removed - if not transaction_id: - transaction_id = str(time.time()) - args = ["cached_label_bulk_update", transaction_id] + extra_args - key, val = get_cache(cls, args) - if val: - return transaction_id, True - cache.set(key, 1, settings.CACHE_SMALLTIMEOUT) - return transaction_id, False - - class RelationItem(models.Model): """ Items with relation between them |