Commit ca844038 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

refactor

parent 40849479
......@@ -26,5 +26,7 @@
}
],
"timeperiod": 3,
"maxperiod" : 47,
"domain" : "BF_NEMO"
}
\ No newline at end of file
......@@ -38,5 +38,6 @@
}
],
"timeperiod": 3,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
......@@ -26,6 +26,7 @@
}
],
"timeperiod": 3,
"maxperiod" : 200,
"domain" : "HELCOM_NEMO"
}
\ No newline at end of file
......@@ -26,5 +26,6 @@
}
],
"timeperiod": 3,
"maxperiod" : 59,
"domain" : "VN_NEMO"
}
\ No newline at end of file
No preview for this file type
......@@ -35,6 +35,8 @@ class Runner(object):
end = datetime.utcnow()
end += timedelta(hours=jdata['timeperiod'])
if (timeperiod):
if (timeperiod > jdata['maxperiod']):
timeperiod = jdata['maxperiod']
end = datetime.utcnow()
end += timedelta(hours=timeperiod)
setting['end'] = end.strftime("%Y-%m-%d %H:%M")+':00'
......
No preview for this file type
......@@ -13,11 +13,12 @@ def main(method):
for m in mlist:
m(24, 'validate', 300);
sleep(3)
elif method == 'b':
raise ValueError('B is not implemented')
elif method == 'long':
for m in mlist:
m(200, 'validate', 300);
sleep(3)
else:
raise ValueError('Validation method is not defined. Try using python validate.py all')
sys.exit(0)
except Exception as error:
print error
......@@ -29,5 +30,5 @@ if __name__ == "__main__":
method = ''
if (len(sys.argv) > 1):
method = sys.argv[1]
main(method)
main(method)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment