forked from expo/troggle
Attempt fix to MariaDB crash in databasereset
This commit is contained in:
parent
b79eb9a969
commit
1395ac76e9
@ -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.
|
- 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 ?!
|
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 = {}
|
entrances_xslug = {}
|
||||||
caves_xslug = {}
|
caves_xslug = {}
|
||||||
@ -149,9 +151,19 @@ def readcaves():
|
|||||||
|
|
||||||
with transaction.atomic():
|
with transaction.atomic():
|
||||||
print(" - Deleting Caves and Entrances")
|
print(" - Deleting Caves and Entrances")
|
||||||
|
# attempting to avoid MariaDB crash when doing this
|
||||||
|
try:
|
||||||
Area.objects.all().delete()
|
Area.objects.all().delete()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
Cave.objects.all().delete()
|
Cave.objects.all().delete()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
try:
|
||||||
Entrance.objects.all().delete()
|
Entrance.objects.all().delete()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
# Clear the cave data issues and the caves as we are reloading
|
# Clear the cave data issues and the caves as we are reloading
|
||||||
DataIssue.objects.filter(parser='areas').delete()
|
DataIssue.objects.filter(parser='areas').delete()
|
||||||
DataIssue.objects.filter(parser='caves').delete()
|
DataIssue.objects.filter(parser='caves').delete()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user