monitoring ftp
This commit is contained in:
@@ -721,23 +721,33 @@ def update_rolling_cp(r, types, mode='water'):
|
||||
powerdf.drop_duplicates(subset='Delta', keep='first', inplace=True)
|
||||
|
||||
res2 = datautils.cpfit(powerdf)
|
||||
p1 = res2[0]
|
||||
# calculate FTP
|
||||
hourseconds = 3600.
|
||||
pwr = p1[0]/(1+hourseconds/p1[2])
|
||||
pwr += p1[1]/(1+hourseconds/p1[3])
|
||||
|
||||
if len(powerdf) != 0:
|
||||
if mode == 'water':
|
||||
p1 = res2[0]
|
||||
r.p0 = p1[0]
|
||||
r.p1 = p1[1]
|
||||
r.p2 = p1[2]
|
||||
r.p3 = p1[3]
|
||||
r.cpratio = res2[3]
|
||||
r.save()
|
||||
if pwr > r.ftp*(100.-r.otwslack)/100. and r.getemailnotifications and not r.emailbounced:
|
||||
_ = myqueue(queuehigh, handle_sendemail_newftp(r,pwr,'water'))
|
||||
|
||||
else:
|
||||
p1 = res2[0]
|
||||
r.ep0 = p1[0]
|
||||
r.ep1 = p1[1]
|
||||
r.ep2 = p1[2]
|
||||
r.ep3 = p1[3]
|
||||
r.ecpratio = res2[3]
|
||||
r.save()
|
||||
if pwr > r.ftp and r.getemailnotifications and not r.emailbounced:
|
||||
_ = myqueue(queuehigh, handle_sendemail_newftp(r,pwr,'water'))
|
||||
|
||||
|
||||
return True
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user