mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 05:58:45 +00:00
wrap in try/except so continues
This commit is contained in:
@@ -476,8 +476,6 @@ class LoadingSurvex:
|
|||||||
parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
parser="survex", message=message, url=None, sb=(survexblock.survexfile.path)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def save_survexblocks_to_db(self):
|
def save_survexblocks_to_db(self):
|
||||||
"""This saves the in-memory python objects into the database, at which point
|
"""This saves the in-memory python objects into the database, at which point
|
||||||
the foreign keys are enabled and one can do queries on the database.
|
the foreign keys are enabled and one can do queries on the database.
|
||||||
@@ -700,8 +698,14 @@ class LoadingSurvex:
|
|||||||
parser="survex",
|
parser="survex",
|
||||||
message=message
|
message=message
|
||||||
)
|
)
|
||||||
|
try:
|
||||||
|
SurvexPersonRole.objects.bulk_create(valid_list)
|
||||||
|
except Exception as e:
|
||||||
|
message = f"\n ! - EXCEPTION '{e}' - in buk update. Falling back on sequential updates"
|
||||||
|
print(message)
|
||||||
|
print(message, file=sys.stderr)
|
||||||
|
stash_data_issue(parser="survex", message=message)
|
||||||
|
|
||||||
SurvexPersonRole.objects.bulk_create(valid_list)
|
|
||||||
|
|
||||||
_pending_pr_saves = {} # in database now, so empty cache
|
_pending_pr_saves = {} # in database now, so empty cache
|
||||||
|
|
||||||
@@ -742,8 +746,10 @@ class LoadingSurvex:
|
|||||||
qms.append(qm)
|
qms.append(qm)
|
||||||
#qm.save()
|
#qm.save()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
message = f"\n ! - EXCEPTION '{e}' - in buk update. Falling back on sequential updates"
|
||||||
raise
|
print(message)
|
||||||
|
print(message, file=sys.stderr)
|
||||||
|
stash_data_issue(parser="survex", message=message)
|
||||||
|
|
||||||
bulk_kwargs = {
|
bulk_kwargs = {
|
||||||
"update_conflicts": True,
|
"update_conflicts": True,
|
||||||
@@ -755,12 +761,12 @@ class LoadingSurvex:
|
|||||||
bulk_kwargs["unique_fields"] = ['cave', 'blockname', 'grade', 'number', 'expoyear']
|
bulk_kwargs["unique_fields"] = ['cave', 'blockname', 'grade', 'number', 'expoyear']
|
||||||
|
|
||||||
try:
|
try:
|
||||||
QM.objects.bulk_create(qms, **bulk_kwargs)
|
QM.objects.bulk_create(qms, **bulk_kwargs)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pass
|
message = f"\n ! - EXCEPTION '{e}' - in buk update. Falling back on sequential updates"
|
||||||
raise
|
print(message)
|
||||||
|
print(message, file=sys.stderr)
|
||||||
_pending_qm_saves = {} # in database now, so empty cache
|
stash_data_issue(parser="survex", message=message)
|
||||||
|
|
||||||
def add_to_pending(self, survexblock, tm):
|
def add_to_pending(self, survexblock, tm):
|
||||||
"""Collects team names. We might not have a date so cannot validate
|
"""Collects team names. We might not have a date so cannot validate
|
||||||
|
|||||||
Reference in New Issue
Block a user