fix delete
This commit is contained in:
@@ -34,6 +34,7 @@ def clean_old_torrents():
|
||||
expired_date = timezone.now() - timedelta(days=settings.TORRENT_TTL)
|
||||
torrent = Torrent.objects.filter(date_created__lt=expired_date).first()
|
||||
if torrent:
|
||||
print(f"delete torrent {torrent.name}")
|
||||
torrent.delete()
|
||||
|
||||
|
||||
@@ -45,7 +46,7 @@ class Command(BaseCommand):
|
||||
},
|
||||
"clean_old_torrents": {
|
||||
"func": clean_old_torrents,
|
||||
"schedule": 60.0
|
||||
"schedule": 5.0
|
||||
}
|
||||
}
|
||||
histories = {}
|
||||
|
||||
Reference in New Issue
Block a user