summaryrefslogtreecommitdiffstats
path: root/store/management/commands/expire-downloads.py
diff options
context:
space:
mode:
authorRobert Griebl <[email protected]>2022-07-29 23:18:37 +0200
committerRobert Griebl <[email protected]>2023-08-04 12:59:01 +0000
commitb3665620377a06f7b7a012e2ae7b69d222fae435 (patch)
tree8a012e3ffd952197401f79a396e55e3850fee5ce /store/management/commands/expire-downloads.py
parent7259d1a839a698e68bc4a7020a63d2aca79a5ec6 (diff)
Port to python 3 and django 4.0.6HEADdev
PLEASE NOTE: This project is not maintained anymore. It was ported to a Qt 6 cmake setup and a more modern Django and Python version to at least keep it usable for legacy projects. For non-production use-cases, please switch to the new appman-package-server available in the Qt Application Manager starting with version 6.7. Task-number: AUTOSUITE-1368 Change-Id: Idc4f2490a2a4399c03fce761250f4b5ac2612a45 Reviewed-by: Dominik Holland <[email protected]>
Diffstat (limited to 'store/management/commands/expire-downloads.py')
-rw-r--r--store/management/commands/expire-downloads.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/store/management/commands/expire-downloads.py b/store/management/commands/expire-downloads.py
index 94b0d24..012182e 100644
--- a/store/management/commands/expire-downloads.py
+++ b/store/management/commands/expire-downloads.py
@@ -39,7 +39,7 @@ from django.conf import settings
from store.utilities import downloadPath
class Command(BaseCommand):
- help = 'Expires all downloads that are older than 10 minutes'
+ help = 'Expires all downloads that are older than APPSTORE_DOWNLOAD_EXPIRY minutes'
def handle(self, *args, **options):
self.stdout.write('Removing expired download packages')
@@ -50,7 +50,7 @@ class Command(BaseCommand):
for pkg in os.listdir(pkgPath):
t = os.path.getmtime(pkgPath + pkg)
age = time.time() - t
- if age > (10 * 60):
+ if age > (int(settings.APPSTORE_DOWNLOAD_EXPIRY) * 60):
os.remove(pkgPath + pkg)
self.stdout.write(' -> %s (age: %s seconds)' % (pkg, int(age)))