mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 03:08:55 -05:00
[Setup] Fix data deletion. (#3384)
* I'm ready to 🔪 some of these entrypoints
* If we're gonna teardown here, may as well do it right
This commit is contained in:
parent
d6d14617d2
commit
85438e7454
@ -253,7 +253,8 @@ async def remove_instance(
|
||||
|
||||
backend = get_current_backend(instance)
|
||||
driver_cls = drivers.get_driver_class(backend)
|
||||
|
||||
await driver_cls.initialize(**data_manager.storage_details())
|
||||
try:
|
||||
if delete_data is True:
|
||||
await driver_cls.delete_all_data(interactive=interactive, drop_db=drop_db)
|
||||
|
||||
@ -267,6 +268,8 @@ async def remove_instance(
|
||||
safe_delete(data_path)
|
||||
|
||||
save_config(instance, {}, remove=True)
|
||||
finally:
|
||||
await driver_cls.teardown()
|
||||
print("The instance {} has been removed\n".format(instance))
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user