mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 13:03:46 +00:00
bugfix
This commit is contained in:
@@ -1837,9 +1837,7 @@ class LoadingSurvex:
|
|||||||
nlegstotal = 0
|
nlegstotal = 0
|
||||||
self.relativefilename = path
|
self.relativefilename = path
|
||||||
|
|
||||||
# Cache for survex blocks to save at the end
|
self._pending_block_saves = set() # Cache for survex blocks to save at the end
|
||||||
self._pending_parent_saves = set()
|
|
||||||
self._pending_block_saves = set()
|
|
||||||
#self.IdentifyCave(path, svxid, depth) # this will produce null for survex files which are geographic collections
|
#self.IdentifyCave(path, svxid, depth) # this will produce null for survex files which are geographic collections
|
||||||
|
|
||||||
self.currentsurvexfile = survexblock.survexfile
|
self.currentsurvexfile = survexblock.survexfile
|
||||||
@@ -2002,12 +2000,12 @@ class LoadingSurvex:
|
|||||||
|
|
||||||
self.fix_undated(survexblock)
|
self.fix_undated(survexblock)
|
||||||
self.fix_anonymous(survexblock)
|
self.fix_anonymous(survexblock)
|
||||||
# This is the most time-consuming step within *end processing: 47%
|
# This is the most time-consuming step within *end processing: was 47%
|
||||||
# Instead of saving parent here, cache for later
|
# Instead of saving parent here, cache for later
|
||||||
if hasattr(survexblock, 'parent') and survexblock.parent:
|
if hasattr(survexblock, 'parent') and survexblock.parent:
|
||||||
self._pending_block_saves.add(survexblock)
|
self._pending_block_saves.add(survexblock)
|
||||||
try:
|
try:
|
||||||
# This is the second most time-consuming step within *end processing: 35%
|
# This is the second most time-consuming step within *end processing: was 35%
|
||||||
self._pending_block_saves.add(survexblock)
|
self._pending_block_saves.add(survexblock)
|
||||||
# update_fields=["legsall", "legslength"]
|
# update_fields=["legsall", "legslength"]
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -2136,8 +2134,8 @@ class LoadingSurvex:
|
|||||||
# print(f" ! Block {block} is invalid: {e}")
|
# print(f" ! Block {block} is invalid: {e}")
|
||||||
try:
|
try:
|
||||||
BATCH_SIZE = 900
|
BATCH_SIZE = 900
|
||||||
for i in range(0, len(valid_blocks), BATCH_SIZE):
|
for i in range(0, len(blocks), BATCH_SIZE):
|
||||||
SurvexBlock.objects.bulk_update(valid_blocks[i:i+BATCH_SIZE], ["legsall", "legslength", "parent"])
|
SurvexBlock.objects.bulk_update(blocks[i:i+BATCH_SIZE], ["legsall", "legslength", "parent"])
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f"\n !! Error in bulk_update for survexblocks: {e}", file=sys.stderr)
|
print(f"\n !! Error in bulk_update for survexblocks: {e}", file=sys.stderr)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user