Skip to content

Commit

Permalink
Removes local software file cleanup
Browse files Browse the repository at this point in the history
This code can be convenient for the developer but could be dangerous when
running in production. Deleting software will also delete linked rollouts,
so something that should not be done lightly.

Finally, the code would be in the wrong place - not closely connected with
the database init.
  • Loading branch information
tsagadar committed Aug 28, 2024
1 parent c7792fb commit c673ac3
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions goosebit/db/db.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
from tortoise import Tortoise, run_async

from goosebit.db.config import TORTOISE_CONF
from goosebit.db.models import Software


async def init():
await Tortoise.init(config=TORTOISE_CONF)

for software in await Software.all():
if software.local and not software.path.exists():
# delete it
await software.delete()


async def close():
await Tortoise.close_connections()
Expand Down

0 comments on commit c673ac3

Please sign in to comment.