
5 Nov
2020
5 Nov
'20
11:20 a.m.
TO ALL
+def main(hostname) + start_time = Time.new.strftime('%Y-%m-%d %H:%M:%S') + log_file = "#{LOG_DIR}/#{hostname}"
main() 函数不宜出现上述执行细节。这约等于让公司董事长去扫地。。 doc/code-spec.md: - 函数要有分层结构. 每个函数须有明确的定位: 业务层逻辑, 还是底层支持性routine. 一个函数不能同时做两个层次的事. 同一函数内避免混杂不同类型的事务.
+ record_runtime(log_file, start_time) + run_vm(hostname) + duration = ((Time.new - Time.parse(start_time)) / 60).round(2) + record_runtime(log_file, duration, is_start: false) +end