Adding limit to the number of stored files.

This commit is contained in:
Marat Fayzullin 2023-02-21 23:05:11 -05:00
parent 7a56366cbf
commit 89bc51b1f9
4 changed files with 12 additions and 4 deletions

View File

@ -162,6 +162,7 @@ defaultConfig = PropertyLayer(
callsign_url="https://www.qrzcq.com/call/{}",
usage_policy_url="policy",
session_timeout=0,
keep_files=20,
decoding_queue_workers=2,
decoding_queue_length=10,
wsjt_decoding_depth=3,

View File

@ -25,7 +25,7 @@ class FilesController(WebpageController):
for f in files[keepN:]:
try:
os.unlink(dir + "/" + f)
except:
except Exception:
pass
def template_variables(self):

View File

@ -70,18 +70,24 @@ class GeneralSettingsController(SettingsFormController):
NumberInput(
"max_clients",
"Maximum number of clients",
infotext="Number of people who can connect at the same time.",
),
NumberInput(
"keep_files",
"Maximum number of files",
infotext="Number of received images and other files to keep.",
),
NumberInput(
"session_timeout",
"Session timeout",
infotext="User session timeout in seconds (0 to disable timeout).",
infotext="Client session timeout in seconds (0 to disable timeout).",
append="secs",
),
TextInput(
"usage_policy_url",
"Usage policy URL",
infotext="Specifies web page describing receiver usage policy "
+ "and shown when the user session times out.",
+ "and shown when a client session times out.",
),
),
Section(

View File

@ -19,7 +19,8 @@ class ReceiverDetails(PropertyFilter):
"photo_title",
"photo_desc",
"usage_policy_url",
"session_timeout",
"session_timeout",
"keep_files",
)
)