Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
b5721674
Commit
b5721674
authored
Oct 21, 2016
by
HERBERT Ryan
Browse files
disk space email
Added email notifications to admins when disk space passes below the allowed threshhold
parent
865b6a75
Changes
3
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/controllers/default.py
View file @
b5721674
...
...
@@ -133,6 +133,9 @@ def run_request():
error
=
""
enough_space
=
vidjil_utils
.
check_enough_space
(
defs
.
DIR_RESULTS
)
if
not
enough_space
:
mail
.
send
(
to
=
defs
.
ADMIN_EMAILS
,
subject
=
"[Vidjil] Server space"
,
message
=
"The space in directory %s has passed below %d\%."
%
(
defs
.
DIR_RESULTS
,
defs
.
FS_LOCK_THRESHHOLD
))
return
error_message
(
"Runs are temporarily disabled. System admins have been made aware of the situation."
)
##TODO check
...
...
server/web2py/applications/vidjil/controllers/file.py
View file @
b5721674
...
...
@@ -27,6 +27,9 @@ def add():
else
:
enough_space
=
vidjil_utils
.
check_enough_space
(
defs
.
DIR_SEQUENCES
)
if
not
enough_space
:
mail
.
send
(
to
=
defs
.
ADMIN_EMAILS
,
subject
=
"[Vidjil] Server space"
,
message
=
"The space in directory %s has passed below %d\%."
%
(
defs
.
DIR_SEQUENCES
,
defs
.
FS_LOCK_THRESHHOLD
))
return
error_message
(
"Uploads are temporarily disabled. System admins have been made aware of the situation."
)
patient_id
=
None
...
...
server/web2py/applications/vidjil/modules/vidjil_utils.py
View file @
b5721674
...
...
@@ -420,8 +420,4 @@ def check_enough_space(directory):
available
=
int
(
available
)
size
=
int
(
size
)
result
=
available
>=
(
size
*
(
defs
.
FS_LOCK_THRESHHOLD
/
100
))
#if not result:
# mail.send(to=defs.ADMIN_EMAILS,
# subject="[Vidjil] Server space",
# message="The space in directory %s has passed below %d\%." % (directory, defs.FS_LOCK_THRESHHOLD))
return
result
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment