summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--parsers/caves.py18
1 files changed, 15 insertions, 3 deletions
diff --git a/parsers/caves.py b/parsers/caves.py
index 6c9d749..4290efc 100644
--- a/parsers/caves.py
+++ b/parsers/caves.py
@@ -24,6 +24,8 @@ todo='''- db Update does not work when a cave id is in the pending list but a pr
- Cannot use Edit This Page for pendingcaves.txt_edit as Edit This Page is expecting an html file.
So we will need a separate file-editing capability just for this configuration file ?!
+
+- crashes on MariaDB on server when deleting Caves and complains Area needs a non null parent, But this is not true.
'''
entrances_xslug = {}
caves_xslug = {}
@@ -149,9 +151,19 @@ def readcaves():
with transaction.atomic():
print(" - Deleting Caves and Entrances")
- Area.objects.all().delete()
- Cave.objects.all().delete()
- Entrance.objects.all().delete()
+ # attempting to avoid MariaDB crash when doing this
+ try:
+ Area.objects.all().delete()
+ except:
+ pass
+ try:
+ Cave.objects.all().delete()
+ except:
+ pass
+ try:
+ Entrance.objects.all().delete()
+ except:
+ pass
# Clear the cave data issues and the caves as we are reloading
DataIssue.objects.filter(parser='areas').delete()
DataIssue.objects.filter(parser='caves').delete()