summaryrefslogtreecommitdiff
path: root/sbhs_server/settings.py
diff options
context:
space:
mode:
Diffstat (limited to 'sbhs_server/settings.py')
-rw-r--r--sbhs_server/settings.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/sbhs_server/settings.py b/sbhs_server/settings.py
index 1b6091f..82c95d7 100644
--- a/sbhs_server/settings.py
+++ b/sbhs_server/settings.py
@@ -63,6 +63,7 @@ INSTALLED_APPS = (
#'yaksh',
'taggit',
#'corsheaders'
+ 'django_crontab',
'account',
'myadmin',
@@ -137,6 +138,7 @@ EMAIL_HOST = 'smtp.gmail.com' #'smtp-auth.iitb.ac.in'
EMAIL_PORT = 587 #25
EMAIL_HOST_USER = credentials.EMAIL_HOST_USER
EMAIL_HOST_PASSWORD = credentials.EMAIL_HOST_PASSWORD
+ADMIN_EMAIL=credentials.ADMIN_EMAIL
# Static files (CSS, JavaScript, Images)
@@ -184,6 +186,10 @@ TEMPLATES = [
},
]
+CRONJOBS = [
+ ('2 * * * *', 'maintenance.health_monitor.main', '>> /tmp/health_monitor.log'),
+]
+
import warnings
warnings.filterwarnings(
'ignore', r"DateTimeField .* received a naive datetime",
@@ -254,13 +260,13 @@ with open(os.path.join(BASE_DIR, 'map_machine_ids.txt')) as f:
for line in f:
try:
data = line.split("=")
- MID_PORT_MAP[int(data[0])]=data[1].strip()
brd = sbhs.Sbhs()
b = brd.connect(int(data[0]))
assert b == True
- key = int(brd.getMachineId())
+ key = int(brd.getMachineId())
assert key > 0
brd.reset_board()
+ MID_PORT_MAP[key]=data[1].strip()
boards[str(key)] = {"board": brd, "experiment_id": None}
except:
pass
@@ -272,6 +278,6 @@ print "No of machines online : ", len(online_mids)
import sys
print >>sys.stderr, online_mids[1:33] #srikant
#srikant
-#f = open('/tmp/online_mids', 'w')
+#f = open(os.path.join(BASE_DIR, 'maintenance/online_mids.txt'), 'w')
#f.write(online_mids)
#f.close()